Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Jan 20, 2026

What does this PR do?

Fixes docs for realtime with the most updated info.

Test Plan

Manual.

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

Summary by CodeRabbit

  • Documentation

    • Rewrote realtime API docs to use parameterized placeholders for database, table, and row IDs in examples and narrative.
    • Clarified channel patterns, wildcard usage, subscription signatures, and callback naming across languages.
    • Corrected upsert event path to use plural "rows" and updated its return type to Row Object.
  • Chores

    • Updated linting configuration to disable a specific Svelte navigation rule.

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

@ItzNotABug ItzNotABug self-assigned this Jan 20, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Walkthrough

The PR updates three areas: adds the ESLint rule disable svelte/no-navigation-without-resolve in eslint.config.js; changes the upsert event path in src/partials/databases-events.md from databases.*.tables.*.row.*.upsert to databases.*.tables.*.rows.*.upsert and changes the associated return type from Document Object to Row Object; and revises the realtime docs in src/routes/docs/apis/realtime/+page.markdoc to replace hard-coded channel strings with parameterized placeholders (databases.<DATABASE_ID>.tables.<TABLE_ID>.rows.<ROW_ID>), update subscription example forms and callback variable names, adjust language examples and channel/table documentation, and make minor formatting tweaks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: realtime api ref docs' directly relates to the main change: updating realtime API reference documentation with the most current information.

✏️ 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
Contributor

@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: 1

🤖 Fix all issues with AI agents
In `@src/routes/docs/apis/realtime/`+page.markdoc:
- Around line 384-388: The JSON example contains a trailing comma after the last
element in the array
("databases.default.tables.sample.rows.63c98b9baea0938e1206"); remove that
trailing comma so the array ends with the final string and the next property
"timestamp" follows validly, ensuring the snippet in +page.markdoc is valid
JSON.
🧹 Nitpick comments (1)
eslint.config.js (1)

27-28: Consider adding a comment explaining why this rule is disabled.

Similar to the existing comment for no-undef, a brief explanation for disabling svelte/no-navigation-without-resolve would help future maintainers understand the rationale.

✏️ Suggested improvement
         rules: {
             // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
             // see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
             'no-undef': 'off',
+            // Navigation patterns in this codebase don't require preloading with $app/navigation's preloadData/preloadCode
             'svelte/no-navigation-without-resolve': 'off'
         }

Copy link
Contributor

@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: 1

🤖 Fix all issues with AI agents
In `@src/routes/docs/apis/realtime/`+page.markdoc:
- Around line 242-244: The example uses realtime.subscribe with multiple string
arguments but the Kotlin SDK expects a single List<String> for channels; update
the call to pass channels as a list (e.g., use listOf(...)) when calling
realtime.subscribe("token", listOf(...)) or the overload used in this doc so the
channels parameter is a List<String> (reference: realtime.subscribe and listOf
in the snippet).
🧹 Nitpick comments (1)
src/routes/docs/apis/realtime/+page.markdoc (1)

415-495: Align placeholder names in channel tables with earlier examples.

The text uses <ID> while the examples use <DATABASE_ID>, <TABLE_ID>, <ROW_ID>, etc. Consider updating the tables to match for clarity.

✏️ Example consistency tweak
-* `databases.<ID>.tables.<ID>.rows`
+* `databases.<DATABASE_ID>.tables.<TABLE_ID>.rows`
...
-* `databases.<ID>.tables.<ID>.rows.<ID>`
+* `databases.<DATABASE_ID>.tables.<TABLE_ID>.rows.<ROW_ID>`
...
-* `buckets.<ID>.files`
+* `buckets.<BUCKET_ID>.files`
...
-* `buckets.<ID>.files.<ID>`
+* `buckets.<BUCKET_ID>.files.<FILE_ID>`
...
-* `executions.<ID>`
+* `executions.<EXECUTION_ID>`
...
-* `functions.<ID>`
+* `functions.<FUNCTION_ID>`
...
-* `teams.<ID>`
+* `teams.<TEAM_ID>`
...
-* `memberships.<ID>`
+* `memberships.<MEMBERSHIP_ID>`

Copy link
Contributor

@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: 1

🤖 Fix all issues with AI agents
In `@src/routes/docs/apis/realtime/`+page.markdoc:
- Around line 156-159: The Swift example uses the wrong parameter label for the
Appwrite SDK: change the call to use the channels parameter and pass an array of
channel strings (i.e., use realtime.subscribe(channels: ["account"]) {...}) so
the signature matches the SDK; update the example where realtime.subscribe is
invoked to replace channel: "account" with channels: ["account"] and keep the
callback closure unchanged.

Comment on lines +156 to +159
let subscription = realtime.subscribe(channel: "account") { response in
// Callback will be executed on all account events.
print(String(describing: response))
})
}
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 20, 2026

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

🌐 Web query:

Appwrite Swift SDK realtime subscribe method signature

💡 Result:

Likely signature:

func subscribe(channels: [String], _ callback: @escaping (RealtimeMessage) -> Void) -> RealtimeSubscription

(Example usage: let subscription = realtime.subscribe(channels: ["files"]) { message in ... } ). [1][2]

Sources:
[1] Appwrite Getting Started for Apple — Realtime example. (swyger.agglomy.com)
[2] Appwrite Realtime docs (subscribe examples). (appwrite.io)

Citations:


Update Swift example to match the official Appwrite SDK signature.

The official Appwrite Swift SDK realtime.subscribe method requires channels: [String], not channel: String. Update the parameter label and wrap the value in an array.

🔧 Fix
-let subscription = realtime.subscribe(channel: "account") { response in
+let subscription = realtime.subscribe(channels: ["account"]) { response in
     // Callback will be executed on all account events.
     print(String(describing: response))
 }
🤖 Prompt for AI Agents
In `@src/routes/docs/apis/realtime/`+page.markdoc around lines 156 - 159, The
Swift example uses the wrong parameter label for the Appwrite SDK: change the
call to use the channels parameter and pass an array of channel strings (i.e.,
use realtime.subscribe(channels: ["account"]) {...}) so the signature matches
the SDK; update the example where realtime.subscribe is invoked to replace
channel: "account" with channels: ["account"] and keep the callback closure
unchanged.

Copy link
Member Author

@ItzNotABug ItzNotABug Jan 20, 2026

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch the Realtime.swift source code to verify the method signatures
curl -s "https://raw.githubusercontent.com/appwrite/sdk-for-apple/main/Sources/Appwrite/Services/Realtime.swift" | sed -n '120,140p'

Length of output: 627


@ItzNotABug You're absolutely right, and I apologize for the incorrect suggestion. I've verified the source code, and the SDK indeed supports both method signatures:

  1. subscribe(channel: String, callback:) - for subscribing to a single channel
  2. subscribe(channels: Set<String>, callback:) - for subscribing to multiple channels

The code in your PR using channel: "account" is perfectly valid. Thank you for the correction and for providing the source reference!

@ItzNotABug ItzNotABug merged commit 13a3a73 into main Jan 20, 2026
6 checks passed
@ItzNotABug ItzNotABug deleted the fix-dat-1040 branch January 20, 2026 12:03
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