-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Dart SDK update for version 20.0.0 #100
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request updates many Dart example docs to initialize Client with a chained .setSession('') call. It adds session propagation to Account.createOAuth2Token, extends Databases.createCollection to accept optional attributes and indexes, and extends TablesDB.createTable to accept optional enabled, columns, and indexes. The SDK package version and telemetry headers were bumped to 20.1.0 and CHANGELOG/README/pubspec were updated accordingly. Several example files were edited to reflect the new Client chaining. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (3)
🔇 Additional comments (2)
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
♻️ Duplicate comments (8)
docs/examples/account/update-phone-session.md (1)
5-6: Verify empty string semantics for setSession.This example follows the same pattern as other account examples in this PR, adding
.setSession('')to the Client initialization chain. The concern about empty string semantics applies here as well.See the verification request in
docs/examples/account/create-mfa-challenge.mdfor details on confirming the intended usage pattern.docs/examples/account/create-anonymous-session.md (1)
5-6: Verify empty string semantics for setSession.This example demonstrates the same Client initialization pattern with
.setSession('')that appears consistently across all account examples in this PR.The same verification applies: confirm whether an empty string is the correct way to indicate no session, or if the call should be omitted when no session is available. See verification request in
docs/examples/account/create-mfa-challenge.md.docs/examples/account/create-email-token.md (1)
5-6: Consistent pattern across documentation examples.This file follows the same changes as the other account examples (adding
.setSession('')). The same documentation clarity recommendation applies here.docs/examples/account/update-magic-url-session.md (1)
5-6: Consistent with other documentation updates in this PR.This file applies the same
.setSession('')pattern. The documentation clarity recommendations from earlier comments apply here as well.docs/examples/account/create-jwt.md (1)
5-6: Consistent with other documentation updates in this PR.This file applies the same
.setSession('')pattern. The documentation clarity recommendations from earlier comments apply here as well.docs/examples/account/create-o-auth-2-token.md (1)
5-6: Consistent with other documentation updates in this PR.This file applies the same
.setSession('')pattern. The documentation clarity recommendations from earlier comments apply here as well.docs/examples/account/create.md (1)
5-6: Consistent with other documentation updates in this PR.This file applies the same
.setSession('')pattern. The documentation clarity recommendations from earlier comments apply here as well.docs/examples/account/create-email-password-session.md (1)
5-6: Consistent with other documentation updates in this PR.This file applies the same
.setSession('')pattern. The documentation clarity recommendations from earlier comments apply here as well.
🧹 Nitpick comments (2)
docs/examples/account/create-magic-url-token.md (1)
5-6: Consider clarifying empty session usage in documentation example.The
.setSession('')pattern appears throughout official Appwrite Dart SDK documentation, but for better clarity in end-user documentation, the comment could explicitly indicate this is a placeholder:- .setSession(''); // The user session to authenticate with + .setSession(''); // Replace with actual user session IDThis would help developers understand that the empty string is a template placeholder, not the intended runtime value.
docs/examples/account/create-phone-token.md (1)
5-6: Clarify the session placeholder in the example.The
.setSession('')method is shown with an empty string, which may confuse developers about the intended usage. The inline comment suggests it should contain "The user session to authenticate with", yet the example demonstrates an empty value.Consider one of the following approaches:
- Replace the empty string with a more realistic placeholder like
'<USER_SESSION>'to make the intent clearer.- Add an explanatory comment explaining that this is a placeholder and developers should substitute their actual session token.
Applied change example:
Client client = Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID - .setSession(''); // The user session to authenticate with + .setSession('<USER_SESSION>'); // Replace with actual user sessionAlternatively, if empty session is the intended initialization pattern:
.setSession(''); // Initialize with session support (replace '' with actual session token when available)
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
docs/examples/account/create-anonymous-session.md(1 hunks)docs/examples/account/create-email-password-session.md(1 hunks)docs/examples/account/create-email-token.md(1 hunks)docs/examples/account/create-jwt.md(1 hunks)docs/examples/account/create-magic-url-token.md(1 hunks)docs/examples/account/create-mfa-challenge.md(1 hunks)docs/examples/account/create-o-auth-2-token.md(1 hunks)docs/examples/account/create-phone-token.md(1 hunks)docs/examples/account/create-session.md(1 hunks)docs/examples/account/create.md(1 hunks)docs/examples/account/update-magic-url-session.md(1 hunks)docs/examples/account/update-phone-session.md(1 hunks)docs/examples/databases/create-collection.md(1 hunks)docs/examples/tablesdb/create-table.md(1 hunks)lib/services/account.dart(1 hunks)lib/services/databases.dart(2 hunks)lib/services/tables_db.dart(2 hunks)
🔇 Additional comments (9)
docs/examples/tablesdb/create-table.md (1)
19-20: LGTM! New optional parameters for table creation.The addition of
columnsandindexesparameters allows defining table schema at creation time, reducing the need for subsequent API calls. The empty array defaults are appropriate for demonstration purposes.lib/services/databases.dart (2)
262-264: LGTM! API extended to support schema definition at creation.The method signature correctly adds
attributesandindexesas optional parameters.
274-275: LGTM! Parameters conditionally included in request payload.The implementation properly checks for null values before including attributes and indexes in the API request.
docs/examples/databases/create-collection.md (1)
19-20: LGTM! Documentation updated to reflect new API parameters.The example correctly demonstrates the new optional
attributesandindexesparameters. The empty arrays serve as placeholders; developers should populate these with actual attribute and index definitions when needed.lib/services/tables_db.dart (2)
246-248: LGTM! Method signature extended with schema definition parameters.The addition of
enabled,columns, andindexesas optional parameters allows defining table structure at creation time, consistent with thecreateCollectionpattern indatabases.dart.
257-259: LGTM! Parameters properly conditionally included.The implementation correctly adds the new parameters to the request payload only when they are provided.
docs/examples/account/create-mfa-challenge.md (1)
5-6: The.setSession('')pattern is correct per Appwrite SDK documentation.The
.setSession('')empty string is the standard Appwrite pattern shown in official API examples, used when initializing the client without an active session. This is intentional—the SDK'ssetSessionmethod authenticates a user when a session exists, or can be initialized without one. The example code is accurate as written.lib/services/account.dart (1)
1017-1017: Session parameter addition is safe and properly filtered.The implementation correctly adds the
sessionparameter to OAuth2 token requests. Null values are safely filtered from the query string before transmission (line 79), so if the session is not configured, it won't be included in the request to the backend.docs/examples/account/create-session.md (1)
5-6: Contextually consistent, but documentation clarity recommendation applies here too.Like the previous file, the
.setSession('')usage follows the same pattern. In this specific example (creating a session), the empty string is semantically sensible—no session exists before creation. However, the documentation should still clarify this relationship.The pattern is consistent with the rest of the PR. If the same empty-string pattern is used across all examples, ensure the documentation or inline comments make it clear to users whether they should:
- Use empty string when no session exists (pre-authentication flow)
- Pass their actual session ID when using authenticated endpoints
This PR contains updates to the Dart SDK for version 20.0.0.
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.