Skip to content

Bug: GraphQLIndexer.subscribe sends subscribe before connection_ack #513

Description

@Jaydbrown

src/indexer.ts:162-173 — on socket.onopen the client sends connection_init and then immediately, in the same tick, sends the subscribe message.

The graphql-transport-ws protocol requires the client to wait for the server's connection_ack before sending any subscribe. A spec-compliant server (graphql-ws, Hasura, Apollo Router, …) closes the socket with 4401/4408 when it receives subscribe first.

Impact

Subscriptions fail against compliant GraphQL servers; onclose then fires and the subscription is torn down (silently — see the companion issue). Only lenient servers work.

Suggested fix

Track handshake state: send subscribe only after receiving { type: 'connection_ack' }; queue the subscribe payload until then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programbugSomething isn't workingpriority: mediumMissing feature or UX issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions