-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected WebSocketTransport connections #1705
Comments
I'm fine with a PR if you do the |
that's only partial fix, if you do something like webSocketTransport.updateHeaderValues(...)
webSocketTransport.updateConnectingPayload(...) while connected, it will still do more connects/disconnects than expected. maybe something like webSocketTransport.updateHeaderValues(..., reconnectIfConnected: false)
webSocketTransport.updateConnectingPayload(..., reconnectIfConnected: true) |
looking at reconnectWebSocket() potentially it has bug as well webSocketTransport.pauseWebSocketConnection()
webSocketTransport.updateHeaderValues(...)
DispatchQueue.global().async {
webSocketTransport.resumeWebSocketConnection()
} what is value of |
Fair in that we don't have that disconnect/reconnect explicitly documented (which they should be), but making any of those changes won't take effect without disconnecting and reconnecting if you're already connected. I'm fine with adding a |
Released as part of 0.43.0! |
Bug report
I would have created PR bout it's potentially breaking change...
-[WebSocketTransport updateHeaderValues:]
-[WebSocketTransport updateConnectingPayload:]
"reconnects" not connected socket - it shouldn't - there is reason why it is not connected. At least it should check if it's connected and then reconnect, but even better it should do nothing and allow developer to decide what to do. Because if you updating both (headers and payload) you creating unnecessary reconnects, in some cases developer might not even want to connect on those changes (my case)
Steps to reproduce
https://github.com/apollographql/apollo-ios/blob/main/Sources/ApolloWebSocket/WebSocketTransport.swift#L303
https://github.com/apollographql/apollo-ios/blob/main/Sources/ApolloWebSocket/WebSocketTransport.swift#L308
The text was updated successfully, but these errors were encountered: