Skip to content

Commit 5527ceb

Browse files
committed
fix logic
1 parent 17fc03f commit 5527ceb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

AppSyncRealTimeClient/ConnectionProvider/AppsyncRealtimeConnectionAsync/RealtimeConnectionProviderAsync+Websocket.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ extension RealtimeConnectionProviderAsync: AppSyncWebsocketDelegate {
3131
return
3232
}
3333
#if os(watchOS)
34+
AppSyncLogger.debug(
35+
"[RealtimeConnectionProvider] on watchOS, received disconnect."
36+
)
3437
self.updateCallback(event: .error(ConnectionProviderError.connection(
3538
"This API uses low-level networking (websockets). Running on watchOS only works for specific circumstances.",
3639
error)))

AppSyncRealTimeClient/Websocket/Starscream/StarscreamAdapter.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public class StarscreamAdapter: AppSyncWebsocketProvider {
6868
AppSyncLogger.debug(
6969
"[StarscreamAdapter] Manually send disconnect."
7070
)
71-
self.delegate?.websocketDidDisconnect(provider: self, error: nil)
71+
let error = ConnectionProviderError.connection("WatchOS Error", nil)
72+
delegate?.websocketDidDisconnect(provider: self, error: error)
7273
} else {
7374
AppSyncLogger.debug(
7475
"[StarscreamAdapter] watchOS subscriptions are connected within 3s."

0 commit comments

Comments
 (0)