Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Jan 13, 2026

This PR contains updates to the Flutter SDK for version 20.3.3.

Summary by CodeRabbit

  • New Features

    • Added optional duration parameter for JWT creation
    • Introduced new mock-unverified OAuth provider option
    • Made data parameter optional for database create/upsert operations
  • Bug Fixes

    • Fixed boolean parameter handling in client requests
  • Documentation

    • Updated examples and compatibility information for version 20.3.3

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Walkthrough

This pull request releases version 20.3.3 of the SDK with several updates. The changes include bumping the version number across configuration and client files, updating copyright year in the LICENSE, and modifying API signatures to make certain parameters optional (data in Databases methods, duration in Account.createJWT). The Output enum is removed and replaced with ImageFormat for avatars. Documentation examples are updated to reflect new parameter handling, and a fix is implemented to properly handle boolean values in GET request parameters. The OAuthProvider enum gains a new mockUnverified value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: a version bump and release for the Flutter SDK from 20.3.2 to 20.3.3, which is reflected across multiple files including version headers, changelog, and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @lib/services/account.dart:
- Around line 120-125: Update the createJWT method docstring to include the new
optional parameter `duration`: state that `duration` is an optional integer
(non-negative, can be 0) representing the token lifetime in seconds (or the same
unit used by the API), note any constraints such as non-negative values and
typical limits if known, and give a short example/mention that passing 0 is
supported per the examples; reference the createJWT function name so the
docstring change is applied to that method.

In @lib/services/storage.dart:
- Around line 113-116: The apiParams map in the uploadFile (or wherever this
snippet is) unconditionally includes 'permissions' which is nullable, causing a
null to be sent to the API; change the map construction for apiParams to include
'permissions' only when permissions != null (same conditional inclusion pattern
as used in createFile) so that 'permissions' is omitted when null rather than
set to null.
🧹 Nitpick comments (3)
lib/src/client_mixin.dart (1)

47-54: LGTM! The boolean handling fix is correct.

The fix properly converts boolean values to strings for GET query parameters, which is necessary since URL query parameters are string-based.

Optional: The int, double, and bool cases all call .toString(). You could consolidate them for brevity:

♻️ Optional consolidation
-            if (value is int || value is double) {
-              filteredParams[key] = value.toString();
-            } else if (value is bool) {
+            if (value is int || value is double || value is bool) {
               filteredParams[key] = value.toString();
-            } else if (value is List) {
+            } else if (value is List) {
README.md (1)

10-10: Consider specifying the server version explicitly.

Using "latest" for server compatibility is ambiguous and may cause confusion for users trying to match SDK and server versions. Consider documenting the actual compatible server version (e.g., 1.8.x as shown in the badge on line 5).

docs/examples/account/create-jwt.md (1)

9-11: Consider using a more meaningful example value for duration.

Using duration: 0 in the example may confuse users about the expected behavior. If 0 means "use server default" that's fine, but if it means "immediate expiry" or is invalid, a more practical example like duration: 900 (15 minutes) would better demonstrate the parameter's purpose.

💡 Suggested improvement
 Jwt result = await account.createJWT(
-    duration: 0, // optional
+    duration: 900, // optional - duration in seconds
 );
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2b5cf8 and 20a98e3.

📒 Files selected for processing (21)
  • CHANGELOG.md
  • LICENSE
  • README.md
  • docs/examples/account/create-jwt.md
  • docs/examples/avatars/get-screenshot.md
  • docs/examples/databases/update-document.md
  • docs/examples/databases/upsert-document.md
  • docs/examples/tablesdb/update-row.md
  • docs/examples/tablesdb/upsert-row.md
  • lib/enums.dart
  • lib/services/account.dart
  • lib/services/avatars.dart
  • lib/services/databases.dart
  • lib/services/storage.dart
  • lib/src/client_browser.dart
  • lib/src/client_io.dart
  • lib/src/client_mixin.dart
  • lib/src/enums/o_auth_provider.dart
  • lib/src/enums/output.dart
  • pubspec.yaml
  • test/services/databases_test.dart
💤 Files with no reviewable changes (2)
  • lib/src/enums/output.dart
  • test/services/databases_test.dart
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~12-~12: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help ...

(EN_WEAK_ADJECTIVE)


[grammar] ~12-~12: Use a hyphen to join words.
Context: ...e development tasks behind a very simple to use REST API. Appwrite aims to help y...

(QB_NEW_EN_HYPHEN)


[grammar] ~12-~12: Use a hyphen to join words.
Context: ...evelopment tasks behind a very simple to use REST API. Appwrite aims to help you ...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (15)
lib/src/client_io.dart (1)

61-61: LGTM!

SDK version header correctly updated to 20.3.3, consistent with the pubspec.yaml version.

lib/src/client_browser.dart (1)

43-43: LGTM!

SDK version header correctly updated to 20.3.3, consistent with client_io.dart and pubspec.yaml.

pubspec.yaml (1)

2-3: LGTM!

Version bump to 20.3.3 is consistent with the client headers, and the grammar correction in the description improves subject-verb agreement.

LICENSE (1)

1-1: LGTM!

Copyright year appropriately updated to 2026.

CHANGELOG.md (1)

3-5: LGTM!

Changelog entry appropriately documents the boolean parameter fix. The fix is confirmed implemented in client_mixin.dart where boolean values are properly converted to strings (.toString()) when building GET request query parameters.

lib/enums.dart (1)

12-12: LGTM!

The addition of image_format.dart part directive is consistent with the enum migration from Output to ImageFormat across the SDK.

docs/examples/tablesdb/upsert-row.md (1)

15-21: LGTM!

The example now demonstrates realistic usage with populated user data fields, which is more helpful for developers than an empty object. The // optional comment correctly reflects the API change making data optional.

lib/services/avatars.dart (1)

222-222: LGTM!

The parameter type migration from enums.Output? to enums.ImageFormat? is consistent with the enum refactoring in this SDK version. The usage pattern remains unchanged.

docs/examples/avatars/get-screenshot.md (1)

33-33: LGTM!

The documentation examples correctly reflect the enum rename from Output to ImageFormat, consistent with the library changes in lib/services/avatars.dart. Both code examples are updated consistently.

Also applies to: 64-64

README.md (1)

22-22: LGTM!

The dependency version correctly reflects the SDK version 20.3.3 being released.

lib/src/enums/o_auth_provider.dart (1)

43-44: The mockUnverified enum value is not an official Appwrite OAuth provider and should not be included in this enum.

The enum pattern and serialization are correctly implemented, but Appwrite does not provide official built-in mock OAuth providers for testing. The documented OAuth providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, and zoom. Neither mock nor mockUnverified are supported by the Appwrite server.

If mock OAuth testing is needed, use external mocking tools (Beeceptor, Mockoon) instead of adding unsupported provider values to the enum. Remove both mock and mockUnverified from this enum.

Likely an incorrect or invalid review comment.

lib/services/databases.dart (1)

217-234: LGTM! Optional data parameter properly implemented.

The change to make data optional in upsertDocument is correctly implemented:

  • The parameter is properly nullable (Map? data)
  • The conditional inclusion (if (data != null)) prevents sending null values in the request payload

This allows upsert operations that only modify permissions without requiring document data.

docs/examples/tablesdb/update-row.md (1)

15-21: Documentation improvement looks good.

The example now demonstrates realistic usage with meaningful field values instead of an empty object. The // optional comment correctly reflects that the data parameter is no longer required.

docs/examples/databases/update-document.md (1)

15-21: Documentation correctly updated with example payload.

The example is consistent with other documentation updates in this PR and demonstrates realistic usage.

docs/examples/databases/upsert-document.md (1)

15-21: Documentation correctly reflects the optional data parameter.

The example payload aligns with the API change in lib/services/databases.dart where upsertDocument's data parameter is now optional.

Comment on lines +120 to +125
Future<models.Jwt> createJWT({int? duration}) async {
const String apiPath = '/account/jwts';

final Map<String, dynamic> apiParams = {};
final Map<String, dynamic> apiParams = {
if (duration != null) 'duration': duration,
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, check the createJWT method implementation
cat -n lib/services/account.dart | sed -n '110,135p'

Repository: appwrite/sdk-for-flutter

Length of output: 1130


🏁 Script executed:

# Check docstring pattern for other methods in this file
rg -A 10 "Future<" lib/services/account.dart | head -50

Repository: appwrite/sdk-for-flutter

Length of output: 1492


🏁 Script executed:

# Search for duration parameter documentation
rg -n "duration" lib/services/account.dart

Repository: appwrite/sdk-for-flutter

Length of output: 181


🏁 Script executed:

# Search for any documentation about duration parameter
rg -n "duration" --type md --type txt docs/ 2>/dev/null | head -20

Repository: appwrite/sdk-for-flutter

Length of output: 135


🏁 Script executed:

# Check if there's an API specification or reference
find . -name "*.md" -o -name "*.txt" | xargs rg -l "createJWT\|duration" 2>/dev/null | head -10

Repository: appwrite/sdk-for-flutter

Length of output: 50


🏁 Script executed:

# Check for other similar parameters and how they're documented in docstrings
rg -B 5 "Future<models\." lib/services/account.dart | grep -A 5 "///"

Repository: appwrite/sdk-for-flutter

Length of output: 15603


Add parameter documentation for duration to the docstring.

The implementation is correct and follows the established pattern for optional parameters. However, the docstring (lines 115-119) completely omits the new duration parameter. Update the docstring to document what this parameter does and its valid range or constraints. The example in docs/examples/account/create-jwt.md shows it accepts values like 0, which could serve as a reference.

🤖 Prompt for AI Agents
In @lib/services/account.dart around lines 120 - 125, Update the createJWT
method docstring to include the new optional parameter `duration`: state that
`duration` is an optional integer (non-negative, can be 0) representing the
token lifetime in seconds (or the same unit used by the API), note any
constraints such as non-negative values and typical limits if known, and give a
short example/mention that passing 0 is supported per the examples; reference
the createJWT function name so the docstring change is applied to that method.

Comment on lines 113 to 116
final Map<String, dynamic> apiParams = {
'name': name,
if (name != null) 'name': name,
'permissions': permissions,
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n lib/services/storage.dart | head -130 | tail -30

Repository: appwrite/sdk-for-flutter

Length of output: 1287


🏁 Script executed:

# Check the function signature to see parameter types
rg -n "permissions" lib/services/storage.dart -B5 -A2

Repository: appwrite/sdk-for-flutter

Length of output: 1694


🏁 Script executed:

# Check how apiParams is used after being defined
rg -n "apiParams" lib/services/storage.dart -A10

Repository: appwrite/sdk-for-flutter

Length of output: 3629


Inconsistent null handling for permissions parameter.

The name parameter is conditionally included only when non-null (line 114), but permissions on line 115 is unconditionally included. Since permissions is also nullable (List<String>?), this will send a null value to the API when not provided, whereas the createFile method in the same file correctly uses conditional inclusion for permissions (line 62).

Apply the same conditional pattern:

🔧 Suggested fix
     final Map<String, dynamic> apiParams = {
       if (name != null) 'name': name,
-      'permissions': permissions,
+      if (permissions != null) 'permissions': permissions,
     };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
final Map<String, dynamic> apiParams = {
'name': name,
if (name != null) 'name': name,
'permissions': permissions,
};
final Map<String, dynamic> apiParams = {
if (name != null) 'name': name,
if (permissions != null) 'permissions': permissions,
};
🤖 Prompt for AI Agents
In @lib/services/storage.dart around lines 113 - 116, The apiParams map in the
uploadFile (or wherever this snippet is) unconditionally includes 'permissions'
which is nullable, causing a null to be sent to the API; change the map
construction for apiParams to include 'permissions' only when permissions !=
null (same conditional inclusion pattern as used in createFile) so that
'permissions' is omitted when null rather than set to null.

@abnegate abnegate merged commit ee5eddd into main Jan 13, 2026
1 check passed
@ItzNotABug ItzNotABug self-assigned this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants