Skip to content

feat(graphql): reply with pong when the server sends a ping - #878

Merged
stdevi merged 3 commits into
masterfrom
stdevi/subscription-pong-on-ping
Aug 3, 2026
Merged

feat(graphql): reply with pong when the server sends a ping#878
stdevi merged 3 commits into
masterfrom
stdevi/subscription-pong-on-ping

Conversation

@stdevi

@stdevi stdevi commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Answer a server-initiated ping with a pong, as the graphql-transport-ws protocol requires, in preparation for the /graphql/subscription-v2 migration.

Why

PROTOCOL.md defines Ping/Pong as bidirectional:

A Pong must be sent in response from the receiving party as soon as possible.

The client only ever sent pings and received pongs. A server-initiated ping has no id, so it fell through parseIncomingMessage's default to unrecognized, found no subscriber, and was silently dropped.

Stanislav Deviatykh and others added 3 commits August 3, 2026 11:48
The graphql-transport-ws protocol defines ping/pong as bidirectional and
requires the receiving party to answer a ping as soon as possible. The
client only ever sent pings, so a server-initiated ping fell through to
'unrecognized' and was silently dropped.

Inert on the legacy endpoint, which never initiates a ping (its heartbeat
is 'ka'); this prepares the client for /graphql/subscription-v2, whose
handler is configured with a 10s keep-alive that pings idle connections.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@stdevi
stdevi marked this pull request as ready for review August 3, 2026 08:56
@stdevi
stdevi requested a review from KonradPaluch August 3, 2026 08:56
@stdevi stdevi self-assigned this Aug 3, 2026
@stdevi
stdevi added this pull request to the merge queue Aug 3, 2026
@stdevi
stdevi marked this pull request as draft August 3, 2026 12:31
Merged via the queue into master with commit a499eec Aug 3, 2026
10 checks passed
@stdevi
stdevi deleted the stdevi/subscription-pong-on-ping branch August 3, 2026 12:31
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