Hi,
I’m trying to use some subscriptions, but I believe something is failing in the first connection.
When I try to subscribe, I have a subscription with success but without any value, after 5 minutes I get “websocket is disconnected” and then start to receive the events.
Another thing I notice is subscription without authorization works instantaneity.
Does someone know what happens?
let url = URL(string: "wss://myServer/graphql")!
let webSocketClient = WebSocket(url: url, protocol: .graphql_transport_ws)
let authPayload = ["authorization": APIManager.shared.keychain.getAuthToken()]
let webSocketTransport = WebSocketTransport(websocket: webSocketClient)
webSocketTransport.updateHeaderValues(authPayload)
return webSocketTransport
}()
subscriptionAPI.getAllPings(result: { requestResult in
print("🔥⏰ \(requestResult)")
})
Logs: success(nil)
firstName success(nil)
2023-02-09 12:25:38.311432+0000 YEO[16928:4076625] [] nw_path_necp_check_for_updates Failed to copy updated result (22)
2023-02-09 12:28:16.568009+0000 YEO[16928:4077396] 10.3.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
2023-02-09 12:28:16.595982+0000 YEO[16928:4077396] 10.3.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
2023-02-09 12:28:16.617302+0000 YEO[16928:4077396] 10.3.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
2023-02-09 12:28:16.633992+0000 YEO[16928:4077396] 10.3.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
2023-02-09 12:28:16.651636+0000 YEO[16928:4077396] 10.3.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
“websocket is disconnected”
2023-02-09 12:30:07.815090+0000 YEO[16928:4077992] [] nw_path_necp_check_for_updates Failed to copy updated result (22)
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“time”: AnyHashable(“2023-02-09T12:30:12.284Z”), “__typename”: AnyHashable(“SyncEvent_PING”)])], _variables: nil))))
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“time”: AnyHashable(“2023-02-09T12:30:17.285Z”), “__typename”: AnyHashable(“SyncEvent_PING”)])], _variables: nil))))
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“__typename”: AnyHashable(“SyncEvent_PING”), “time”: AnyHashable(“2023-02-09T12:30:22.286Z”)])], _variables: nil))))
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“__typename”: AnyHashable(“SyncEvent_PING”), “time”: AnyHashable(“2023-02-09T12:30:27.288Z”)])], _variables: nil))))
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“__typename”: AnyHashable(“SyncEvent_PING”), “time”: AnyHashable(“2023-02-09T12:30:32.288Z”)])], _variables: nil))))
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“__typename”: AnyHashable(“SyncEvent_PING”), “time”: AnyHashable(“2023-02-09T12:30:37.290Z”)])], _variables: nil))))
success(Optional(YEO.SyncEvent_PINGSubscription.Data(__data: Apollo.DataDict(_data: [“SyncEvent_PING”: AnyHashable([“time”: AnyHashable(“2023-02-09T12:30:42.291Z”), “__typename”: AnyHashable(“SyncEvent_PING”)])], _variables: nil))))