feat: Apple SDK update for version 17.1.0#112
Conversation
Made-with: Cursor
Made-with: Cursor
Greptile SummaryThis PR updates the Apple SDK to version 17.1.0, adding new Presence and Advisor (Reports/Insights) services, refactoring Realtime to use post-connect
Confidence Score: 3/5The PR has two definite crash paths in the model layer that affect SDK users, on top of several concurrency issues from earlier review rounds that remain unresolved. User.from(map:) silently drops the optional semantics of hashOptions making it always non-nil, and Document/Row from(map:) crash via try! for any strongly-typed T when the data key is absent from the response. Sources/AppwriteModels/User.swift, Sources/AppwriteModels/Document.swift, Sources/AppwriteModels/Row.swift, Sources/Appwrite/Services/Realtime.swift Important Files Changed
|
| private func createSocketLocked() async throws { | ||
| let hasPendingPresence: Bool = presenceSync.sync { pendingPresence != nil } | ||
| guard activeSubscriptions.count > 0 || hasPendingPresence else { | ||
| reconnect = false |
There was a problem hiding this comment.
Channels and queries are no longer included in the WebSocket URL
The new createSocketLocked constructs the URL with project=<id> only, dropping the channels[] and per-slot query parameters that were previously appended. Subscription data is now sent as a subscribe message after the connected event. If the Appwrite server still expects channels in the initial URL handshake, all realtime subscriptions will silently receive no events. Please confirm this matches the updated server-side protocol for 17.1.0. Does the Appwrite 17.1.0 server accept channel subscriptions via a post-connect subscribe WebSocket message rather than URL query parameters?
There was a problem hiding this comment.
expected and we follow this only
# Conflicts: # CHANGELOG.md # README.md # Sources/Appwrite/Client.swift # Sources/Appwrite/Services/Realtime.swift
| password: map["password"] as? String, | ||
| hash: map["hash"] as? String, | ||
| hashOptions: map["hashOptions"] as? [String: AnyCodable], | ||
| hashOptions: (map["hashOptions"] as? [String: Any] ?? [:]).mapValues { AnyCodable($0) }, |
There was a problem hiding this comment.
hashOptions loses its optional semantics. The ?? [:] fallback means hashOptions is always a non-nil empty dict when the key is absent from the server response, so any caller checking user.hashOptions != nil will now always see a truthy value. The correct fix chains ?.mapValues so the optional remains nil when the key is absent.
| hashOptions: (map["hashOptions"] as? [String: Any] ?? [:]).mapValues { AnyCodable($0) }, | |
| hashOptions: (map["hashOptions"] as? [String: Any])?.mapValues { AnyCodable($0) }, |
This PR contains updates to the Apple SDK for version 17.1.0.
What's Changed
presenceschannel andRealtimePresencetypes for presence subscriptionsAdvisorandPresencesservicesInsight,Presence, andReportmodels with list variantsfusionauth,keycloak, andkickproviders toOAuthProviderenumX-Appwrite-Response-Formatheader to1.9.5