Repository navigation
feat: Flutter SDK update for version 28.0.0 - #341
Conversation
🔵 Tier A · Mergeable after minor fixes
This update brings the Flutter SDK to 28.0.0 with Appwrite 2.5 response handling, expanded query APIs, and new Apps, OAuth2, passkey, analytics, and push capabilities. It also adds Android push integration and refreshes the package documentation and examples. 17 of 142 changed files were too large to include in full.
Note Not approving while a bug finding is open: Parse the OAuth2 grant prompt using the 2.5 response shape Fix with agent prompt### Issue 1
lib/src/client_mixin.dart:172-178
**Flatten nested query lists recursively**
Only direct `QueryBuilder` elements are expanded here. A nested list such as `[Query.builder().equal('x', 1).build()]` passes through unchanged, so `Client.flatten` and request preparation leave `queries` nested instead of producing the flat query-string list promised by the new API; GET requests then serialize the inner list as one value.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 8
⏳ Still open from earlier reviews · 1
Reviewed |
|
@hansi-codes review |
| if (value is! List || !value.any((item) => item is QueryBuilder)) { | ||
| return value; | ||
| } | ||
| return [ | ||
| for (final item in value) | ||
| if (item is QueryBuilder) ...item.build() else item, | ||
| ]; |
There was a problem hiding this comment.
Flatten nested query lists recursively
Only direct QueryBuilder elements are expanded here. A nested list such as [Query.builder().equal('x', 1).build()] passes through unchanged, so Client.flatten and request preparation leave queries nested instead of producing the flat query-string list promised by the new API; GET requests then serialize the inner list as one value.
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/src/client_mixin.dart
Line: 172-178
Comment:
**Flatten nested query lists recursively**
Only direct `QueryBuilder` elements are expanded here. A nested list such as `[Query.builder().equal('x', 1).build()]` passes through unchanged, so `Client.flatten` and request preparation leave `queries` nested instead of producing the flat query-string list promised by the new API; GET requests then serialize the inner list as one value.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.🟡 Minor · bug · Reply if this doesn't apply.
There was a problem hiding this comment.
Not changing this one. Every generated method types queries as List<String>? (realtime too), so [builder.build()] (a List<List<String>>) does not compile against any of them; a builder only reaches _flattenValue through a hand-built client.call params map. Flattening nested lists recursively would also flatten nested values that must stay nested, such as geometry coordinates.
There was a problem hiding this comment.
The generated service signatures do rule out passing a nested list to listDocuments(queries:). But the reported path is still reachable: public Client.call accepts Map<String, dynamic>, and its implementations pass those params through prepareRequest (Client.call, request preparation). For example, params: {'queries': [Query.builder().equal('x', 1).build()]} reaches _flattenValue; because the inner list contains no QueryBuilder directly, it is returned unchanged (flattening logic). The GET path then passes that nested value to URI query construction (GET handling).
The public flatten method also explicitly documents support for “nested query-string lists” (Client.flatten). Flattening arbitrary nested values could indeed break geometry coordinates, but that doesn’t resolve the query-list case; the flattening should preserve unrelated nested values.
|
@hansi-codes review |
This PR contains updates to the SDK for version 28.0.0.
What's Changed
X-Appwrite-Response-Format: 2.5.0; responses follow the 2.5 shapesClient.chunkedUploadtakes aresponseTypeparameter; customClientimplementations must add it>=3.10.0and Flutter>=3.38.1ClientaddssetPushEndpoint,setPushClientIdandflatten; customClientimplementations must add themAppsservice to manage apps, installations, keys and secretsOauth2service for the OAuth2 authorize, token, device and grant flowsPushservice with background delivery on AndroidTopichelper and MQTT exportsio.appwrite.flutter, so apps can also depend onsdk-for-android; set the notification icon with theio.appwrite.flutter.push.notification_iconmeta-dataQueryaggregates (count,countDistinct,sum,avg,min,maxand more),groupBy,having,distinct, joins,relationship,covers,spatialEqualsandpageQuery.builder()to chain queries;build()returns the query listExecutionTrigger.emailprefs, default to an empty mappromptvalue in a listAlso in this diff
mainwas behind the release tags, which were cut from release branches. This PR brings it up to date, so the diff also contains these already-released versions:27.1.0
accountpasskey methodslistPasskeys,createPasskey,getPasskey,updatePasskey,deletePasskeyandupdatePasskeyVerificationaccount.createPasskeyTokenandaccount.updatePasskeyTokenfor passkey sign-inPasskey,PasskeyList,PasskeyChallengeandTokenSecretmodels27.2.0
analytics.createEventin a newAnalyticsservice to send tracking eventsTrackinghelper for app lifecycle events and screen views, andTrackingObserverfor automatic route trackingavatars.updatePhotoandavatars.deletePhototo manage the user's custom profile photo, and theAccountmodelWebflowto theOAuthProviderenumstateonaccount.createOAuth2Sessionandaccount.createOAuth2Token, returned unchanged on the success and failure URLsdurationonaccount.createEmailPasswordSessionto set the session lengthcurrentonaccount.deleteSessionsto keep the current session signed inmembershipIdonteams.createMembershiptotalonaccount.listSessions, thelocalelist methods andlistTransactions