Skip to content

feat(gql_socket_link): BREAKING CHANGE multiplex websocket connection #491

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

agufagit
Copy link
Collaborator

@agufagit agufagit commented May 21, 2025

@knaeckeKami I'm making a breaking change in graphql_transport_ws.dart, please take a look

Streaming operations and single result operations are now multiplexed on a single connection. This means you have to manually resubscribe on subscriptions. On IOS and Android, when you app is in background (lock screen, etc.), all open sockets will be closed to save battery, and your app is freezed, no code from your app will run. Thus there is no way to reconnect a websocket connection when it is broken because no code from your app will run, you have to manually resubscribe on app resume (use WidgetsBindingObserver or related packages). You can use old TransportWebSocketLink client to resubscribe, the underlying socket is newly acquired when you resubscribe.

@knaeckeKami
Copy link
Collaborator

Can you explain the change you did a bit more? From what I understand, there has always been just one WebSocket connection, no? And the code changes mostly add commented out code, I don't see any actual change in behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants