feat(graphql): block retry if connection not established#854
Merged
Conversation
raluik
approved these changes
Jun 12, 2026
raluik
reviewed
Jun 12, 2026
added 2 commits
June 15, 2026 09:48
raluik
reviewed
Jun 15, 2026
added 2 commits
June 15, 2026 10:58
raluik
approved these changes
Jun 15, 2026
…graphql-subscriptions-fixture.ts Co-authored-by: Rando Luik <47411930+raluik@users.noreply.github.com>
…graphql-subscriptions-fixture.ts Co-authored-by: Rando Luik <47411930+raluik@users.noreply.github.com>
…graphql-subscriptions-fixture.ts Co-authored-by: Rando Luik <47411930+raluik@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Back off the GraphQL WebSocket reconnect loop when the socket repeatedly fails to establish, so the SDK stops minting a new temporary API key on every retry.
When a client's firewall blocks
wss://(but not HTTPS), every reconnect attempt fetched a fresh temporary API key over HTTPS and then failed the WebSocket handshake forever, ~1 key/minute per device.So now we:
consecutiveFailedHandshakes).MAX_FAILED_HANDSHAKES(5), the existing reconnect loop backs off to a flatBLOCKED_RETRY_INTERVAL_MS(5 min) instead of the fast exponential backoff.GQL_CONNECTION_ACK, so it recovers automatically once the connection succeeds.How to test
Set up sign-in-wrapper with javascript-api and ipad-sig-in on master first.
Navigate to name.local and set up iPad.
Go to uBlock Origin settings:

Go to
My filtersand disable websockets:*$websocketYou will see how iPad created keys.
Then switch to this PR for javascript-api. The backoff will be applied.