8000 Fix stale connection IDs in WebSocket client state machine by hugo-vrijswijk · Pull Request #840 · gemini-hlsw/clue · GitHub
[go: up one dir, main page]

Skip to content

Fix stale connection IDs in WebSocket client state machine - #840

Merged
hugo-vrijswijk merged 1 commit into
mainfrom
fix/f13-f18-stale-connection-id
Sep 4, 2026
Merged

hugo-vrijswijk merged 1 commit into
mainfrom
fix/f13-f18-stale-connection-id

Conversation

@hugo-vrijswijk
Copy link
Copy Markdown
Contributor

Prevent stale connect and initialize results from being applied to the current connection when the state has advanced to a later connection ID.

In doConnect, add a guard to compare the connection ID from the async result with the current state's ID. Drop stale results and close their sockets in the background to prevent leaks.

In doInitialize, add a guard to stop fibers from a replaced connection from racing the current fiber.

Adds test suite to verify stale connections are dropped and their sockets are closed without causing errors.

@mergify mergify Bot added the core label Sep 4, 2026
@mergify
mergify Bot commented Sep 4, 2026
Copy link
Copy Markdown
< 8000 /details>
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@hugo-vrijswijk
hugo-vrijswijk force-pushed the fix/f13-f18-stale-connection-id branch from 419c2aa to 5a8564d Compare September 4, 2026 10:54
Prevent stale `connect` and `initialize` results from being applied to the current connection when the state has advanced to a later connection ID.

In `doConnect`, add a guard to compare the connection ID from the async result with the current state's ID. Drop stale results and close their sockets in the background to prevent leaks.

In `doInitialize`, add a guard to stop fibers from a replaced connection from racing the current fiber.

Adds test suite to verify stale connections are dropped and their sockets are closed without causing errors.
@hugo-vrijswijk
hugo-vrijswijk force-pushed the fix/f13-f18-stale-connection-id branch from 5a8564d to 8aaabca Compare September 4, 2026 10:58
@mergify mergify Bot added the sbt-plugin label Sep 4, 2026
@hugo-vrijswijk
hugo-vrijswijk merged commit e83c5c3 into main Sep 4, 2026
13 checks passed
@hugo-vrijswijk
hugo-vrijswijk deleted the fix/f13-f18-stale-connection-id branch September 4, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0