Skip to content

fix(indexer): reconnect GraphQL subscriptions after unexpected WebSocket close (#514) - #582

Merged
Jaydbrown merged 6 commits into
conduit-protocol:mainfrom
namdamdoi68-oss:fix/514-graphql-indexer-ws-reconnect
Aug 31, 2026
Merged

fix(indexer): reconnect GraphQL subscriptions after unexpected WebSocket close (#514)#582
Jaydbrown merged 6 commits into
conduit-protocol:mainfrom
namdamdoi68-oss:fix/514-graphql-indexer-ws-reconnect

Conversation

@namdamdoi68-oss

Copy link
Copy Markdown
Contributor

Closes #514

GraphQLIndexer.subscribe tore the WebSocket down on any close without calling onError, so live indexer views froze after a blip. Unexpected close now surfaces onError and retries with the same linear backoff as WebSocketRelayer, and only unsubscribes after the retry budget or an explicit unsubscribe. Covered in graphql-indexer-lifecycle tests.

namdamdoi68-oss and others added 5 commits August 31, 2026 09:13
Unexpected socket close currently unsubscribes with no onError, so live indexer views freeze after a network drop. These cases fail on main and pin reconnect, cancel-during-backoff, and exhausted retries.

Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
… close

Closes conduit-protocol#514.

onclose was calling unsubscribe with no onError. Unexpected close now reports the error and retries with WebSocketRelayer linear backoff, and only tears down after the retry budget or an explicit unsubscribe/cleanup.

Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
maxReconnectAttempts 0 must report exhaustion and drop the subscription without opening a second socket, matching WebSocketRelayer.

Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
api.md and the unreleased changelog now describe unexpected-close onError, Relayer-style backoff, and the optional reconnect bounds.

Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
subscribe() gained public reconnect fields; export GraphQLSubscriptionOptions and related types from the package entry so callers can name them without importing a deep path.

Signed-off-by: namdamdoi68-oss <namdamdoi68@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@namdamdoi68-oss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Jaydbrown
Jaydbrown merged commit b7aa370 into conduit-protocol:main Aug 31, 2026
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.

Bug: GraphQLIndexer.subscribe dies silently on WebSocket close

2 participants