Add PING/PONG protocol actions and heartbeats=bounce (RTN23c) - #522
Open
SimonWoolf wants to merge 3 commits into
Open
SimonWoolf wants to merge 3 commits into
SimonWoolf wants to merge 3 commits into
Conversation
TR2 lists it but the IDL enum stopped at OBJECT_SYNC. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Browsers may freeze background tabs. A frozen tab's websocket continues to answer transport-level ping frames on the page's behalf while none of the page's own code can run, so the server does not detect the client as gone and, for example, its presence members are never removed. heartbeats=bounce asks the server to check liveness at the protocol level instead: it sends PING ProtocolMessages and closes the transport if the client does not answer with a PONG. The client's obligation to answer a PING with a PONG (RTN23c1) is unconditional, so the param is purely the client's request for the server to use this mechanism. Connection#ping (RTN13) is left on HEARTBEAT. Bumps specification version to 6.2.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
splindsay-92
approved these changes
Sep 16, 2026
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.
Problem
Browsers may freeze background tabs (see Chrome's energy-saver freezing). A frozen tab's websocket continues to answer transport-level ping frames on the page's behalf while none of the page's own code can run. Since the server determines liveness from the websocket pong, it never detects the client as gone: presence members are not removed, and so on, even though the session is effectively dead.
Change
PING(22) andPONG(23)ProtocolMessageactions (TR2, IDL,protocol.md).heartbeats=bouncevalue (RTN23b,RTN23c). In this mode the server sendsPINGs instead ofHEARTBEATs to satisfymaxIdleInterval, and closes the transport if the client does not answer with aPONG. Browser clients should send this.RTN23c1/RTN23c2: every client must answer aPINGwith aPONGon the same transport, echoing thePING'sid, regardless of whichheartbeatsvalue it sent. This is unconditional so the param is purely the client's request for the server to use this mechanism.CD2hmentions the new action.bouncequery param,PONGechoingid,PONGregardless ofheartbeatsparam, andPINGresetting the idle timer.ANNOTATIONmember to the IDLProtocolMessageActionenum.Connection#ping(RTN13) is deliberately left onHEARTBEAT; dedicatedPING/PONGavoid the request/response ambiguity (and hence ping-pong loop risk) that reusingHEARTBEATfor server-initiated liveness checks would introduce.🤖 Generated with Claude Code