Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughIntroduces Channel helper fluent API across realtime documentation examples (JS/TS, Flutter, Swift, Kotlin), replacing many raw-string channel identifiers with Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/routes/docs/apis/realtime/+page.markdoc (2)
60-66: Bug: Variable name mismatch in Swift example.Line 62 references
message.events!, but the closure parameter is namedresponse. This will cause a compile error.🐛 Proposed fix
// Subscribe to files channel using Channel helper let subscription = realtime.subscribe(channels: [Channel.bucket().file().toString()]) { response in - if (message.events!.contains("buckets.*.files.*.create")) { + if (response.events!.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(String(describing: response)) } }
246-250: Missing semicolon in Dart example.Dart statements should end with a semicolon. The
listen()call is missing its terminating semicolon.Proposed fix
subscription.stream.listen((response) { // Callback will be executed on all account events. print(response); -}) +});Note: The same issue appears in other Flutter examples at lines 331 and 413.
🤖 Fix all issues with AI agents
In `@src/routes/docs/apis/realtime/`+page.markdoc:
- Around line 581-595: Fix the two typos in the table descriptions: change the
string "to a any team" to "to any team" for the teams entry (near the `teams` /
`Channel.team().toString()` block) and change "to a any membership" to "to any
membership" for the memberships entry (near the `memberships` /
`Channel.membership().toString()` block); update the plain text in +page.markdoc
so the descriptions read "Any create/update/delete events to any team" and "Any
create/update/delete events to any membership" respectively.
🧹 Nitpick comments (2)
src/routes/docs/apis/realtime/+page.markdoc (2)
189-194: Clarify when.toString()is required.The documentation shows
Channel.account()used directly (lines 110, 223) but chained calls likeChannel.database(...).collection(...).document(...)always use.toString(). The guidance "when needed" may confuse developers.Consider explicitly stating which helpers return strings directly versus which require
.toString(), or standardize by always using.toString()for consistency.
611-617: Consider adding a code example for event filtering.The event filtering methods (
.create(),.update(),.delete()) are documented but not demonstrated in the code examples throughout the page. A brief example showing actual usage in a subscription call would help developers understand how to apply these filters.
70e5ab7 to
fb2bab0
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/routes/docs/apis/realtime/`+page.markdoc:
- Around line 383-389: The example inconsistently awaits realtime.subscribe;
change the line using "const subscription = await realtime.subscribe(...)" to
remove the await so it reads "const subscription = realtime.subscribe(...)" to
match other examples (keep awaiting "subscription.close()" if close remains
async); locate "realtime.subscribe" and "subscription.close" in the snippet to
apply this change.
- Around line 592-594: The table entries use inconsistent identifier formatting:
change `executions.[ID]` to `executions.<ID>` and update the Channel call from
`Channel.execution(ID)` to `Channel.execution('<EXECUTION_ID>')` so both match
the angle-bracket and quoted-id style used elsewhere (update the entries
referencing executions.[ID] and Channel.execution(ID) in +page.markdoc
accordingly).
🧹 Nitpick comments (1)
src/routes/docs/apis/realtime/+page.markdoc (1)
140-142: Variable namedocSubscriptionshould berowSubscriptionto align with updated terminology.The variable
docSubscriptionappears in Flutter (line 140), Apple (line 160), and Android (line 184) examples. Since the terminology has been updated from "documents" to "rows", these variables should reflect that.Proposed fix (Flutter example, apply similarly to Apple and Android)
-final docSubscription = realtime.subscribe([ +final rowSubscription = realtime.subscribe([ Channel.tablesdb('<DATABASE_ID>').table('<TABLE_ID>').row('<ROW_ID>') ]);Based on learnings: "In appwrite/website, update terminology to use 'rows' and 'columns' instead of 'documents' and 'collections' across all documentation files."
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit
Documentation
Chores