Skip to content

feat: React Native SDK update for version 0.30.0#104

Merged
ArnabChatterjee20k merged 3 commits into
mainfrom
dev
May 19, 2026
Merged

feat: React Native SDK update for version 0.30.0#104
ArnabChatterjee20k merged 3 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 18, 2026

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

What's Changed

  • Added: Realtime presences channel and RealtimePresence types for presence subscriptions
  • Added: Advisor and Presences services
  • Added: Insight, Presence, and Report models with list variants
  • Added: fusionauth, keycloak, and kick providers to OAuthProvider enum
  • Added: Client.setCookie() method for forwarding cookies in server-side runtimes
  • Updated: X-Appwrite-Response-Format header to 1.9.5

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR updates the React Native SDK to version 0.30.0, adding Advisor and Presences REST services, a presences Realtime channel with upsertPresence() support, three new OAuth providers, a setCookie() client helper, and new Presence, Insight, and Report model types.

  • New services: Advisor (read-only reports/insights) and Presences (CRUD + upsert) are added with both object-param and positional deprecated overloads. The Presences service uses PUT for upsert and PATCH for partial update, consistent with Appwrite conventions.
  • Realtime presence: upsertPresence() uses a single-flight socket creation lock (socketCreationPromise) and an appConnected gate to prevent premature subscription/presence frames. The latest presence payload is automatically re-sent on each reconnect and cleared only on disconnect().
  • Models.Presence is missing a metadata field — both write methods accept it and RealtimePresence already includes it, so typed access to metadata on a fetched Presence requires an explicit cast.

Confidence Score: 5/5

The PR is safe to merge. All core logic changes are well-guarded, the GitHub Actions SHA pins are verified against official releases, and the new services follow established SDK patterns.

The new Realtime presence flow is carefully implemented with a single-flight socket lock and an application-level connected gate. The REST services are straightforward GET/PUT/PATCH/DELETE wrappers. The only gap is a missing metadata field on Models.Presence, which is a type completeness issue and does not affect runtime behavior.

No files require special attention, though src/models.ts could benefit from adding metadata?: Record<string, any> to Models.Presence for consistency with both the write methods and the RealtimePresence type.

Important Files Changed

Filename Overview
src/services/realtime.ts Adds upsertPresence() with single-flight socket creation, fire-and-forget presence sends, and an appConnected guard to prevent premature subscription frames. The RealtimePresence type is missing expiresAt (flagged in a prior thread).
src/models.ts Adds Presence, DefaultPresence, PresenceList, Insight, InsightList, Report, and ReportList types. Models.Presence is missing the metadata field that the service write methods accept and RealtimePresence already includes.
src/services/presences.ts New Presences service with list, get, upsert, update, and delete methods. Unused FileSystem and RNPlatform imports present (flagged in prior thread).
src/services/advisor.ts New read-only Advisor service for reports and insights. Unused FileSystem and RNPlatform imports present (flagged in prior thread).
src/client.ts Adds setCookie() setter for server-side cookie forwarding, bumps SDK version to 0.30.0, and updates X-Appwrite-Response-Format to 1.9.5.
src/channel.ts Adds Presence channel type, Channel.presence() factory, and Channel.presences() static. ActionableChannel union extended accordingly.
.github/workflows/publish.yml Pins actions/checkout to the verified SHA for v6.0.2 and actions/setup-node to v6.4.0 — both hashes confirmed against GitHub releases.
src/enums/o-auth-provider.ts Adds Fusionauth, Keycloak, and Kick OAuth providers in alphabetical order.
src/index.ts Exports Presences and Advisor services.

Reviews (2): Last reviewed commit: "chore: update React Native SDK to 0.30.0" | Re-trigger Greptile

Comment thread src/services/advisor.ts
Comment on lines +5 to +6
import * as FileSystem from 'expo-file-system';
import { Platform as RNPlatform } from 'react-native';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Neither FileSystem nor RNPlatform are referenced anywhere in Advisor — it contains only GET endpoints with no file I/O. These appear to be copy-paste artifacts from upload-capable services (e.g. Storage). Bundlers that don't tree-shake may unnecessarily include the expo-file-system module.

Suggested change
import * as FileSystem from 'expo-file-system';
import { Platform as RNPlatform } from 'react-native';

Comment thread src/services/presences.ts
Comment on lines +5 to +6
import * as FileSystem from 'expo-file-system';
import { Platform as RNPlatform } from 'react-native';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Same unused-import pattern as Advisor: FileSystem and RNPlatform are imported but never referenced in Presences. No method in this service performs any file I/O.

Suggested change
import * as FileSystem from 'expo-file-system';
import { Platform as RNPlatform } from 'react-native';

status: '<STATUS>', // optional
expiresAt: '2020-10-15T06:38:00.000+00:00', // optional
metadata: {}, // optional
permissions: ["read("any")"], // optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 The permission string "read("any")" is a JavaScript syntax error. The inner double-quotes terminate the outer string literal before the closing ), so pasting this snippet will throw a parse error. The file already imports Permission and Role, so the idiomatic form should be used instead.

Suggested change
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional

const result = await presences.upsert({
presenceId: '<PRESENCE_ID>',
status: '<STATUS>',
permissions: ["read("any")"], // optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Same invalid permission string as in update.md"read("any")" is a JavaScript syntax error. The imported Permission and Role helpers should be used here too for consistency and correctness.

Suggested change
permissions: ["read("any")"], // optional
permissions: [Permission.read(Role.any())], // optional

Comment thread src/services/realtime.ts Outdated
@ArnabChatterjee20k ArnabChatterjee20k merged commit bf35b44 into main May 19, 2026
1 check passed
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