-
Notifications
You must be signed in to change notification settings - Fork 147
feat: Flutter SDK update for version 20.3.0 #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 48 files out of 155 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the WalkthroughThis release (20.3.0) introduces two main features and supporting updates: (1) A new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~40 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
lib/operator.dart (1)
160-164: Consider handling optional value inarrayFiltermore explicitly.Currently,
arrayFilteralways includes thevalueparameter in the values array (line 162), even when it's null. This might not be the intended behavior for conditions likeisNullorisNotNullthat don't require a comparison value.Consider updating the implementation to conditionally include the value:
static String arrayFilter(Condition condition, [dynamic value]) { - final values = <dynamic>[condition.value, value]; + final values = <dynamic>[condition.value]; + if (value != null) { + values.add(value); + } return Operator._('arrayFilter', values).toString(); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
CHANGELOG.md(1 hunks)README.md(1 hunks)docs/examples/account/list-identities.md(1 hunks)docs/examples/account/list-logs.md(1 hunks)docs/examples/databases/list-documents.md(1 hunks)docs/examples/functions/list-executions.md(1 hunks)docs/examples/storage/list-files.md(1 hunks)docs/examples/tablesdb/list-rows.md(1 hunks)docs/examples/teams/list-memberships.md(1 hunks)docs/examples/teams/list.md(1 hunks)lib/appwrite.dart(1 hunks)lib/operator.dart(1 hunks)lib/query.dart(1 hunks)lib/services/account.dart(2 hunks)lib/services/databases.dart(2 hunks)lib/services/functions.dart(1 hunks)lib/services/storage.dart(1 hunks)lib/services/tables_db.dart(1 hunks)lib/services/teams.dart(2 hunks)lib/src/client_browser.dart(1 hunks)lib/src/client_io.dart(1 hunks)pubspec.yaml(1 hunks)test/operator_test.dart(1 hunks)test/query_test.dart(1 hunks)
🔇 Additional comments (30)
pubspec.yaml (1)
1-2: Version bump correctly aligned with feature release.Semantic versioning from 20.2.2 to 20.3.0 is appropriate for the new features (total parameter and Operator class). All dependencies remain stable.
lib/src/client_browser.dart (1)
38-45: Version header correctly updated.The x-sdk-version header is properly aligned with the pubspec.yaml version bump (20.3.0). This ensures correct API versioning telemetry.
lib/src/client_io.dart (1)
56-63: Version header correctly updated to match other implementations.The x-sdk-version in ClientIO matches the version in ClientBrowser and pubspec.yaml (20.3.0), maintaining consistency across platform implementations.
docs/examples/account/list-identities.md (1)
9-12: Documentation example updated with new total parameter.The example now demonstrates the optional
totalparameter for listIdentities. Ensure the corresponding Account.listIdentities() method signature in the service layer includes this parameter and passes it to the API.[scratchpad_end] -->
docs/examples/account/list-logs.md (1)
9-12: Documentation example consistently updated across Account service.Parameter placement and documentation style are consistent with other Account service examples (listIdentities). Verify that Account.listLogs() service method includes the total parameter.
docs/examples/functions/list-executions.md (1)
9-13: Documentation example follows consistent pattern across services.The total parameter is documented consistently in Functions.listExecutions(), matching the pattern established in Account service examples. Verify that Functions.listExecutions() method signature includes this parameter.
docs/examples/storage/list-files.md (1)
9-14: Documentation example appropriately positioned given Storage method signature.The total parameter is placed after the search parameter, which is contextually appropriate since Storage.listFiles() has additional parameters compared to Account/Functions list methods. Verify Storage.listFiles() includes the total parameter.
CHANGELOG.md (2)
3-6: Changelog entries clearly document new features.The 20.3.0 section accurately summarizes the two main features: the optional
totalparameter for list queries (performance optimization) and the newOperatorclass for atomic row modifications. Entries are concise and follow the established changelog format.
1-6: Verify service implementation files are included in PR scope.The documentation examples and changelog reference updates to service classes (Account, Databases, Functions, Storage, TablesDB, Teams) to add the
totalparameter, and mention a newlib/operator.dartfile. These implementation files are not visible in the current review scope. Confirm that:
- All service methods documented in examples have corresponding parameter additions
- The new Operator class is properly exported from lib/appwrite.dart
- Query helper methods have been updated with explicit timestamp attributes ($createdAt, $updatedAt)
- Comprehensive tests exist for both new Operator functionality and updated query methods
docs/examples/teams/list-memberships.md (1)
13-13: LGTM! Documentation example updated correctly.The addition of the
totalparameter to the example correctly demonstrates the new optional parameter introduced in the Teams service API.docs/examples/tablesdb/list-rows.md (1)
14-14: LGTM! Documentation example updated correctly.The addition of the
totalparameter to the example correctly demonstrates the new optional parameter introduced in the TablesDB service API.lib/services/functions.dart (1)
11-19: LGTM! Clean implementation of thetotalparameter.The
listExecutionsmethod correctly adds the optionaltotalparameter to both the method signature and API parameters, maintaining backward compatibility.lib/services/tables_db.dart (1)
118-132: LGTM! Clean implementation of thetotalparameter.The
listRowsmethod correctly adds the optionaltotalparameter to both the method signature and API parameters, maintaining backward compatibility.lib/services/storage.dart (1)
10-22: LGTM! Clean implementation of thetotalparameter.The
listFilesmethod correctly adds the optionaltotalparameter to both the method signature and API parameters, maintaining backward compatibility.lib/services/databases.dart (1)
122-137: LGTM! Consistent update to deprecated method.The
listDocumentsmethod correctly adds the optionaltotalparameter, maintaining consistency with other services even though this method is deprecated since 1.8.0 in favor ofTablesDB.listRows.docs/examples/databases/list-documents.md (1)
14-14: LGTM! Documentation example updated correctly.The addition of the
totalparameter to the example correctly demonstrates the new optional parameter introduced in the Databases service API.lib/services/teams.dart (2)
11-19: LGTM! Clean implementation of thetotalparameter.The
listmethod correctly adds the optionaltotalparameter to both the method signature and API parameters, maintaining backward compatibility.
107-119: LGTM! Clean implementation of thetotalparameter.The
listMembershipsmethod correctly adds the optionaltotalparameter to both the method signature and API parameters, maintaining backward compatibility.docs/examples/teams/list.md (1)
9-13: LGTM! Documentation correctly demonstrates the newtotalparameter.The example clearly shows the optional
totalparameter usage in theteams.list()call, which aligns with the API enhancement for controlling row counting behavior.lib/services/account.dart (2)
81-87: LGTM! Thetotalparameter is correctly added tolistIdentities.The optional
totalparameter is properly typed asbool?and correctly propagated to the API parameters, consistent with similar changes across other services.
137-142: LGTM! Thetotalparameter is correctly added tolistLogs.The implementation follows the same pattern as
listIdentitiesand other list methods in the SDK.README.md (1)
24-24: LGTM! Version bump to 20.3.0 is correct.The installation example correctly reflects the new release version.
lib/appwrite.dart (1)
33-33: LGTM! Theoperator.dartpart directive is correctly added.The new part directive properly integrates the Operator API into the library surface, following the existing pattern used for other utilities like
query.dartandpermission.dart.test/query_test.dart (1)
275-315: LGTM! Test expectations correctly updated for timestamp-based queries.The tests now properly verify that:
createdBefore/After/Betweenuse the$createdAtattribute withlessThan/greaterThan/betweenmethodsupdatedBefore/After/Betweenuse the$updatedAtattribute with the same method mappingsThis aligns with the implementation changes in
lib/query.dartthat replaced generic time predicates with explicit attribute-based queries.test/operator_test.dart (1)
1-156: LGTM! Comprehensive test coverage for the Operator API.The test suite thoroughly validates all Operator methods:
- Arithmetic operations (increment, decrement, multiply, divide, modulo, power) with and without bounds
- Array operations (append, prepend, insert, remove, unique, intersect, diff, filter)
- String operations (concat, replace)
- Boolean toggle
- Date operations (addDays, subDays, setNow)
Each test correctly verifies the JSON structure (method name and values array) produced by the Operator factory methods.
lib/query.dart (1)
108-126: LGTM! Timestamp query helpers now use explicit system attributes.The refactored implementation:
- Uses explicit
$createdAtand$updatedAtsystem attributes instead of null attributes- Delegates to generic comparison methods (
lessThan,greaterThan,between)- Provides clearer, more maintainable code
- Maintains the same public API surface
This change makes the query construction more explicit and aligns with Appwrite's internal timestamp field naming.
lib/operator.dart (4)
1-43: LGTM! Well-structured foundation for the Operator API.The
Conditionenum andOperatorclass provide a clean, type-safe foundation for building atomic operation expressions:
- Enum values are properly defined with string representations
- Private constructor prevents direct instantiation
toJson()correctly handles both single values and lists- Consistent with the existing
Queryclass pattern
44-131: LGTM! Robust input validation for arithmetic operations.The arithmetic operations (
increment,decrement,multiply,divide,modulo,power) include comprehensive validation:
- NaN and Infinity checks prevent invalid numeric inputs
- Zero divisor checks prevent runtime errors
- Optional max/min bounds provide flexibility
- Error messages are clear and actionable
133-164: LGTM! Comprehensive array operation support.The array operations cover all common use cases (append, prepend, insert, remove, unique, intersect, diff, filter) with a clean API. The integration with the
Conditionenum for filtering is well-designed.
166-186: LGTM! String, boolean, and date operations are well-implemented.The remaining operations provide useful utilities:
- String operations for concatenation and replacement
- Boolean toggle for flipping values
- Date operations for temporal adjustments
All methods follow the consistent pattern established by the class.
This PR contains updates to the Flutter SDK for version 20.3.0.
Summary by CodeRabbit
Release Notes - Version 20.3.0