feat: Web SDK update for version 23.0.0#159
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:
WalkthroughAdds an optional Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/models.ts`:
- Line 246: The change of Models.Row.$sequence and Models.Document.$sequence
from number to string is a breaking API change; to keep this patch release safe,
revert those fields to the previous type or make them backward-compatible by
changing the declarations for $sequence in models.ts (the Model Row and Document
interfaces/classes) to a union type (number | string) and update any related
type tests or usages (e.g., places referencing Models.Row.$sequence and
Models.Document.$sequence) to accept both types; if you intend a breaking change
instead, prepare a major-version bump and add migration notes/changelog entries
rather than shipping it in a patch.
| * Row sequence ID. | ||
| */ | ||
| $sequence: number; | ||
| $sequence: string; |
There was a problem hiding this comment.
Public $sequence type change is breaking for patch consumers
Changing Models.Row.$sequence (Line 246) and Models.Document.$sequence (Line 285) from number to string is a breaking TypeScript API change and can fail downstream builds in a 22.4.1 patch upgrade. Please either ship this as a major-version break with migration notes, or keep this release backward-compatible.
Backward-compatible patch-safe option
export type Row = {
@@
- $sequence: string;
+ $sequence: number | string;
@@
export type Document = {
@@
- $sequence: string;
+ $sequence: number | string;Also applies to: 285-285
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/models.ts` at line 246, The change of Models.Row.$sequence and
Models.Document.$sequence from number to string is a breaking API change; to
keep this patch release safe, revert those fields to the previous type or make
them backward-compatible by changing the declarations for $sequence in models.ts
(the Model Row and Document interfaces/classes) to a union type (number |
string) and update any related type tests or usages (e.g., places referencing
Models.Row.$sequence and Models.Document.$sequence) to accept both types; if you
intend a breaking change instead, prepare a major-version bump and add migration
notes/changelog entries rather than shipping it in a patch.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/enums/timezone.ts (1)
49-285:⚠️ Potential issue | 🟠 MajorTimezone enum renames constitute a breaking API change for external consumers.
The four renamed members (
AfricaPortonovo→AfricaPortoNovo,AmericaBlancsablon→AmericaBlancSablon,AmericaPortauprince→AmericaPortAuPrince,AsiaUstnera→AsiaUstNera) will cause TypeScript compile failures for any consumer referencing the old names. This is a major version-bump requirement, not a patch-compatible change.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/enums/timezone.ts` around lines 49 - 285, The enum member renames are a breaking API change; restore backward compatibility by keeping the new correct members (AfricaPortoNovo, AmericaBlancSablon, AmericaPortAuPrince, AsiaUstNera) and add deprecated aliases that map the old names (AfricaPortonovo, AmericaBlancsablon, AmericaPortauprince, AsiaUstnera) to the same string values or export const aliases so existing consumers still compile; update any enum usage comments and mark the old aliases as deprecated for removal in the next major version.
🧹 Nitpick comments (1)
src/enums/browser-permission.ts (1)
21-21: ConsiderXRSpatialTrackingoverXrSpatialTracking.
XR(Extended Reality) is a well-established W3C/industry acronym (see the WebXR Device API). The current rename treats it as a normal title-cased word (Xr), whereas other SDK enum members using USB and MIDI are capitalized asUsbandMidifor consistency. Whether the right call here isXRSpatialTrackingorXrSpatialTracking(staying consistent with the existingUsb/Midistyle) is worth a deliberate decision, butXrSpatialTrackingas written may look unusual to developers familiar with WebXR.♻️ Proposed rename
- XrSpatialTracking = 'xr-spatial-tracking', + XRSpatialTracking = 'xr-spatial-tracking',🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/enums/browser-permission.ts` at line 21, Rename the enum member XrSpatialTracking to XRSpatialTracking in the BrowserPermission enum and update all references/usages (imports, switches, tests, serialization/deserialization) accordingly; keep the enum value string as 'xr-spatial-tracking' (i.e., change only the identifier, not the literal) so external wire-format stays stable, and run/type-check to ensure no remaining references to XrSpatialTracking remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/enums/browser-permission.ts`:
- Around line 8-21: Public enum BrowserPermission was changed by renaming
members (e.g., Clipboardread → ClipboardRead, Clipboardwrite → ClipboardWrite,
etc.), which breaks consumers; restore backward compatibility by adding
deprecated aliases that map the old member names to the new string values within
the BrowserPermission enum (e.g., include Clipboardread =
BrowserPermission.ClipboardRead style aliases or duplicate enum entries with the
old identifiers assigned the same string), mark them deprecated in comments, and
update any exported types/docs to mention the new names; ensure the enum retains
the new canonical members (ClipboardRead, ClipboardWrite, PaymentHandler, Usb,
Bluetooth, Accelerometer, Gyroscope, Magnetometer, AmbientLightSensor,
BackgroundSync, PersistentStorage, ScreenWakeLock, WebShare, XrSpatialTracking)
while providing old-name aliases so external TypeScript code continues to
compile.
In `@src/enums/image-gravity.ts`:
- Around line 3-10: Restore backward compatibility by reintroducing the
old-cased enum members as aliases that point to the same string values while
keeping the new-cased members; e.g., add duplicate enum entries (Topleft =
'top-left', Topright = 'top-right', Bottomleft = 'bottom-left', Bottomright =
'bottom-right') alongside TopLeft/TopRight/BottomLeft/BottomRight so consumers
using either identifier compile, and mark the old names as deprecated in
comments; then ensure the package version is bumped to a minor release and add a
short migration note documenting the preferred new member names and the
temporary aliases.
---
Outside diff comments:
In `@src/enums/timezone.ts`:
- Around line 49-285: The enum member renames are a breaking API change; restore
backward compatibility by keeping the new correct members (AfricaPortoNovo,
AmericaBlancSablon, AmericaPortAuPrince, AsiaUstNera) and add deprecated aliases
that map the old names (AfricaPortonovo, AmericaBlancsablon,
AmericaPortauprince, AsiaUstnera) to the same string values or export const
aliases so existing consumers still compile; update any enum usage comments and
mark the old aliases as deprecated for removal in the next major version.
---
Nitpick comments:
In `@src/enums/browser-permission.ts`:
- Line 21: Rename the enum member XrSpatialTracking to XRSpatialTracking in the
BrowserPermission enum and update all references/usages (imports, switches,
tests, serialization/deserialization) accordingly; keep the enum value string as
'xr-spatial-tracking' (i.e., change only the identifier, not the literal) so
external wire-format stays stable, and run/type-check to ensure no remaining
references to XrSpatialTracking remain.
| ClipboardRead = 'clipboard-read', | ||
| ClipboardWrite = 'clipboard-write', | ||
| PaymentHandler = 'payment-handler', | ||
| Usb = 'usb', | ||
| Bluetooth = 'bluetooth', | ||
| Accelerometer = 'accelerometer', | ||
| Gyroscope = 'gyroscope', | ||
| Magnetometer = 'magnetometer', | ||
| Ambientlightsensor = 'ambient-light-sensor', | ||
| Backgroundsync = 'background-sync', | ||
| Persistentstorage = 'persistent-storage', | ||
| Screenwakelock = 'screen-wake-lock', | ||
| Webshare = 'web-share', | ||
| Xrspatialtracking = 'xr-spatial-tracking', | ||
| AmbientLightSensor = 'ambient-light-sensor', | ||
| BackgroundSync = 'background-sync', | ||
| PersistentStorage = 'persistent-storage', | ||
| ScreenWakeLock = 'screen-wake-lock', | ||
| WebShare = 'web-share', | ||
| XrSpatialTracking = 'xr-spatial-tracking', |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the structure and find the file
find . -name "browser-permission.ts" -type fRepository: appwrite/sdk-for-web
Length of output: 97
🏁 Script executed:
# Run the verification script to search for old member name references
rg -n --type ts "(BrowserPermission\.(Clipboardread|Clipboardwrite|Paymenthandler|Ambientlightsensor|Backgroundsync|Persistentstorage|Screenwakelock|Webshare|Xrspatialtracking))"Repository: appwrite/sdk-for-web
Length of output: 46
🏁 Script executed:
# Let's also read the actual browser-permission.ts file to see the current state
cat -n src/enums/browser-permission.tsRepository: appwrite/sdk-for-web
Length of output: 929
No internal references to old BrowserPermission member names remain—internal migration is complete.
This is a breaking API change: renaming public enum members (Clipboardread → ClipboardRead, Clipboardwrite → ClipboardWrite, etc.) will produce TypeScript compile errors in external consumer code using the old identifiers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/enums/browser-permission.ts` around lines 8 - 21, Public enum
BrowserPermission was changed by renaming members (e.g., Clipboardread →
ClipboardRead, Clipboardwrite → ClipboardWrite, etc.), which breaks consumers;
restore backward compatibility by adding deprecated aliases that map the old
member names to the new string values within the BrowserPermission enum (e.g.,
include Clipboardread = BrowserPermission.ClipboardRead style aliases or
duplicate enum entries with the old identifiers assigned the same string), mark
them deprecated in comments, and update any exported types/docs to mention the
new names; ensure the enum retains the new canonical members (ClipboardRead,
ClipboardWrite, PaymentHandler, Usb, Bluetooth, Accelerometer, Gyroscope,
Magnetometer, AmbientLightSensor, BackgroundSync, PersistentStorage,
ScreenWakeLock, WebShare, XrSpatialTracking) while providing old-name aliases so
external TypeScript code continues to compile.
| TopLeft = 'top-left', | ||
| Top = 'top', | ||
| Topright = 'top-right', | ||
| TopRight = 'top-right', | ||
| Left = 'left', | ||
| Right = 'right', | ||
| Bottomleft = 'bottom-left', | ||
| BottomLeft = 'bottom-left', | ||
| Bottom = 'bottom', | ||
| Bottomright = 'bottom-right', | ||
| BottomRight = 'bottom-right', |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat -n src/enums/image-gravity.tsRepository: appwrite/sdk-for-web
Length of output: 392
🏁 Script executed:
rg -n "(Topleft|Topright|Bottomleft|Bottomright)" --type tsRepository: appwrite/sdk-for-web
Length of output: 46
🏁 Script executed:
cat package.json | grep -A 2 -B 2 '"version"'Repository: appwrite/sdk-for-web
Length of output: 364
Breaking public API change shipped as a patch version.
Renaming exported enum members (Topleft → TopLeft, Topright → TopRight, Bottomleft → BottomLeft, Bottomright → BottomRight) is a TypeScript compile-breaking change for any downstream consumer referencing the old member names. Modifying existing enums by renaming values breaks backward compatibility. Internal code has been correctly updated, but external consumers using the old member names will experience compilation failures.
This change is versioned as 22.4.1 (patch). Under semver, a patch increment signals only backward-compatible bug fixes; renaming public API identifiers warrants at minimum a minor version bump (e.g., 22.5.0) and should be accompanied by a migration guide for consumers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/enums/image-gravity.ts` around lines 3 - 10, Restore backward
compatibility by reintroducing the old-cased enum members as aliases that point
to the same string values while keeping the new-cased members; e.g., add
duplicate enum entries (Topleft = 'top-left', Topright = 'top-right', Bottomleft
= 'bottom-left', Bottomright = 'bottom-right') alongside
TopLeft/TopRight/BottomLeft/BottomRight so consumers using either identifier
compile, and mark the old names as deprecated in comments; then ensure the
package version is bumped to a minor release and add a short migration note
documenting the preferred new member names and the temporary aliases.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
README.md (1)
9-9: Vague compatibility statement may confuse users.Changing from a specific server version ("1.8.x") to "latest" reduces clarity for users who need to match SDK versions with their Appwrite server. Consider keeping a specific version reference or linking to a compatibility matrix.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 9, Replace the vague "latest" compatibility statement in README.md with a specific Appwrite server version (e.g., "1.8.x") and/or add a link to a compatibility matrix; update the sentence that currently reads "**This SDK is compatible with Appwrite server version latest...**" to explicitly state the supported server version(s) and include a URL to a compatibility matrix or release notes so consumers can match SDK and server releases.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/channel.ts`:
- Around line 98-124: Add a documented breaking change to CHANGELOG.md
describing that Channel factory methods now require an explicit id and no longer
default to "*" — specifically mention Channel.database, Channel.execution,
Channel.tablesdb, Channel.bucket, Channel.function, Channel.team,
Channel.membership and related factory methods like collection() and table()
which removed optional ID/wildcard behavior; state the user impact, migration
guidance (pass explicit id or use a separate wildcard helper if needed), and the
PR/commit reference for traceability.
In `@src/services/teams.ts`:
- Line 402: Revert the JSDoc descriptions for the {string[]} params.roles
occurrences to state "each 32 characters long" (instead of 81) so they match the
Appwrite Teams API constraint; update every JSDoc block that documents
params.roles (search for "params.roles" in this file and the surrounding comment
blocks) to mention a maximum of 100 roles and that each role is 32 characters
long.
---
Nitpick comments:
In `@README.md`:
- Line 9: Replace the vague "latest" compatibility statement in README.md with a
specific Appwrite server version (e.g., "1.8.x") and/or add a link to a
compatibility matrix; update the sentence that currently reads "**This SDK is
compatible with Appwrite server version latest...**" to explicitly state the
supported server version(s) and include a URL to a compatibility matrix or
release notes so consumers can match SDK and server releases.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
CHANGELOG.mdREADME.mddocs/examples/databases/list-documents.mddocs/examples/tablesdb/list-rows.mdpackage.jsonsrc/channel.tssrc/client.tssrc/models.tssrc/services/databases.tssrc/services/tables-db.tssrc/services/teams.ts
💤 Files with no reviewable changes (1)
- CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
- src/models.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/client.ts (1)
395-395: Use a single source for SDK version metadata.Line 395 hardcodes the SDK version in headers, which duplicates release metadata and can drift over time. Consider injecting this value from a build-time constant tied to
package.jsonversion.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/client.ts` at line 395, Replace the hardcoded 'x-sdk-version': '23.0.0' header in src/client.ts with a single source constant (e.g., SDK_VERSION) that is populated at build time from package.json version; update the header assignment that sets 'x-sdk-version' to use SDK_VERSION, add (or import) the SDK_VERSION constant (populated via your build system or from process.env.npm_package_version or a generated constants module), and ensure the build pipeline injects the package.json version so the value cannot drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/client.ts`:
- Line 395: Replace the hardcoded 'x-sdk-version': '23.0.0' header in
src/client.ts with a single source constant (e.g., SDK_VERSION) that is
populated at build time from package.json version; update the header assignment
that sets 'x-sdk-version' to use SDK_VERSION, add (or import) the SDK_VERSION
constant (populated via your build system or from
process.env.npm_package_version or a generated constants module), and ensure the
build pipeline injects the package.json version so the value cannot drift.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.mdpackage.jsonsrc/client.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
This PR contains updates to the Web SDK for version 23.0.0.