Sean Proctor
02/09/2023, 11:40 AMbod
02/09/2023, 11:44 AMSean Proctor
02/09/2023, 11:48 AMOperation error syncAccount SubscriptionOperationException: Operation error syncAccount
at WebSocketNetworkTransport$execute$o$collect$slambda_1.doResume_5yljmg_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:4950:23)
at WebSocketNetworkTransport$execute$o$collect$slambda_1.invoke_kvy33q_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:4915:16)
at sam$kotlinx_coroutines_flow_FlowCollector$0_3.l [as function_1] (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:5003:16)
at sam$kotlinx_coroutines_flow_FlowCollector$0_3.emit_1fbrsb_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:5357:17)
at SafeCollector.emit_1fbrsb_k$ (webpack-internal:///./kotlin/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js:20332:29)
at WebSocketNetworkTransport$execute$slambda_1.doResume_5yljmg_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:5780:63)
at WebSocketNetworkTransport$execute$slambda_1.invoke_jwaue4_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:5740:16)
at _no_name_provided__qut3iv.l [as $transform_1] (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:5822:16)
at $emitCOROUTINE$1.doResume_5yljmg_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:2394:51)
at _no_name_provided__qut3iv.emit_1fbrsb_k$ (webpack-internal:///./kotlin/apollo-kotlin-apollo-runtime.js:2439:16)
mbonnin
02/09/2023, 11:52 AMSean Proctor
02/09/2023, 12:09 PMbod
02/09/2023, 12:18 PMSean Proctor
02/09/2023, 12:18 PMbod
02/09/2023, 12:19 PMSean Proctor
02/09/2023, 12:20 PMHTTP/1.1 101 WebSocket Protocol Handshake
Date: Thu, 09 Feb 2023 12:15:45 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: CJgK75ri8M62LH3xkkdXjZpCWgk=
Sec-WebSocket-Protocol: graphql-ws
mbonnin
02/09/2023, 12:21 PMSean Proctor
02/09/2023, 12:22 PMmbonnin
02/09/2023, 12:22 PMexception.payload
Sean Proctor
02/09/2023, 12:35 PMApolloClient.Builder()
.httpServerUrl(httpServeUrl)
.addHttpInterceptor(AuthorizationInterceptor(token))
.subscriptionNetworkTransport(
WebSocketNetworkTransport.Builder()
.serverUrl(webSocketServeUrl)
.addHeader("Authorization", "Bearer ${token.value}")
.build()
)
.build()
Works fine on Android. I guess I can only blame myself here.mbonnin
02/09/2023, 1:00 PMaddHeader()
on JS, it should work similarlySean Proctor
02/09/2023, 1:01 PMmbonnin
02/09/2023, 1:03 PMSean Proctor
02/09/2023, 1:09 PMApolloClient.Builder()
.httpServerUrl(httpServeUrl)
.addHttpInterceptor(AuthorizationInterceptor(token))
.webSocketServerUrl(webSocketServeUrl)
.wsProtocol(
SubscriptionWsProtocol.Factory(
connectionPayload = {
mapOf("headers" to mapOf("Authorization" to "Bearer ${token.value}"))
}
)
)
.build()
mbonnin
02/09/2023, 1:25 PM