Skip to content

feat: React Native SDK update for version 2.0.0 - #122

Closed
ChiragAgg5k wants to merge 2 commits into
mainfrom
dev
Closed

ChiragAgg5k wants to merge 2 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

This PR contains updates to the React Native SDK for version 2.0.0.

@hansi-codes

hansi-codes Bot commented Oct 12, 2026

Copy link
Copy Markdown

馃數 Tier A 路 Mergeable after minor fixes

The new response-defaulting path drops the SDK's JSON toString behavior, a minor compatibility regression that needs a fix.

This update targets Appwrite 2.4 and publishes the React Native SDK as version 2.0.0, adding analytics, passkey, OAuth2, and membership API updates. It also adds response-model defaults and new passkey and analytics examples.

4 of 39 changed files were too large to include in full.

Verdict New comments Fixed Still open
馃挰 Commented 1 0 0

Note

Not approving while a bug finding is open: Preserve response toString when cloning models

Finding Where
馃煛 Preserve response toString when cloning models src/client.ts:83
Fix with agent prompt
### Issue 1
src/client.ts:83
**Preserve response toString when cloning models**

`Client.call` attaches a non-enumerable JSON `toString` to parsed responses, but this spread drops it whenever a response passes through `applyDefaults`. As a result, affected API results now stringify as `[object Object]` instead of JSON; preserving the custom method on the cloned root would avoid this compatibility regression.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
馃搨 Walkthrough 路 5
File Change
CHANGELOG.md, README.md, package.json, package-lock.json Update the SDK version and Appwrite target, and document the 2.0.0 API changes.
src/client.ts, src/models.ts, src/index.ts Add response defaulting, new response models, and exports for Analytics.
src/services/account.ts, src/services/oauth-2.ts, src/services/teams.ts, src/services/vectors-db.ts Add passkey and OAuth2 operations, membership ID support, and response defaults.
src/services/analytics.ts, src/services/apps.ts, src/services/avatars.ts, src/services/databases.ts, src/services/documents-db.ts, src/services/functions.ts, src/services/locale.ts, src/services/messaging.ts, src/services/organization.ts, src/services/presences.ts, src/services/storage.ts, src/services/tables-db.ts Add the Analytics service and apply response defaults across service responses.
docs/examples Add passkey and analytics examples and update OAuth2 and membership examples.

Reviewed b7514d1 路 Details 路 Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@hansi-codes hansi-codes Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃數 Tier A 路 See the inline comments. Summary

Comment thread src/client.ts
if (Array.isArray(value)) {
return value;
}
const result: Record<string, unknown> = { ...model.defaults, ...value };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preserve response toString when cloning models

Client.call attaches a non-enumerable JSON toString to parsed responses, but this spread drops it whenever a response passes through applyDefaults. As a result, affected API results now stringify as [object Object] instead of JSON; preserving the custom method on the cloned root would avoid this compatibility regression.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/client.ts
Line: 83

Comment:
**Preserve response toString when cloning models**

`Client.call` attaches a non-enumerable JSON `toString` to parsed responses, but this spread drops it whenever a response passes through `applyDefaults`. As a result, affected API results now stringify as `[object Object]` instead of JSON; preserving the custom method on the cloned root would avoid this compatibility regression.

---

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.

@ChiragAgg5k

Copy link
Copy Markdown
Member Author

Superseded: replaced by a passkeys-only minor release.

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.

1 participant