We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9091023 commit 0b42c94Copy full SHA for 0b42c94
Sources/ApolloWebSocket/WebSocketTransport.swift
@@ -167,10 +167,14 @@ public class WebSocketTransport {
167
self.addApolloClientHeaders(to: &self.websocket.request)
168
169
self.websocket.delegate = self
170
+ // Keep the assignment of the callback queue before attempting to connect. There is the
171
+ // potential of a data race if the connection fails early and the disconnect logic reads
172
+ // the callback queue while it's being set.
173
+ self.websocket.callbackQueue = processingQueue
174
+
175
if config.connectOnInit {
176
self.websocket.connect()
177
}
- self.websocket.callbackQueue = processingQueue
178
179
180
public func isConnected() -> Bool {
0 commit comments