Repository navigation
fix(gateway): stop delivering buffered frames after the transport is closed - #634
Merged
Merged
Conversation
…closed websocket.Conn keeps returning frames it already buffered after Close. A listen goroutine of a replaced connection could therefore still handle e.g. an invalid session from the old connection and clear the session the new connection is resuming with, crashing on the nil SessionID once RESUMED arrives. Fixes #631 Co-authored-by: Saiop68 <sairajpatwardhan399@gmail.com>
topi314
force-pushed
the
fix/gateway-stale-frames-after-close
branch
from
October 23, 2026 18:39
f1c7b09 to
a028b5f
Compare
SessionID, ResumeURL and LastSequenceReceived were pointers on the config that were dereferenced without nil checks and read and written from multiple goroutines without synchronization. The session state now lives in its own struct on the gateway, guarded by sessionMu, with empty values meaning there is nothing to resume. The config fields only provide the initial session, so the config is no longer mutated after New. The public getters keep returning nil when no value is set.
topi314
force-pushed
the
fix/gateway-stale-frames-after-close
branch
from
October 23, 2026 20:14
0296395 to
51bd639
Compare
2 tasks done
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.
websocket.Conn keeps returning frames it already buffered after Close. A listen goroutine of a replaced connection could therefore still handle e.g. an invalid session from the old connection and clear the session the new connection is resuming with, crashing on the nil SessionID once RESUMED arrives.
Fixes #631