fix: unhandled incoming frames before websocket connection is established#6
Open
maslowalex wants to merge 4 commits into
Open
fix: unhandled incoming frames before websocket connection is established#6maslowalex wants to merge 4 commits into
maslowalex wants to merge 4 commits into
Conversation
… connection is established
reconnect/1 rebuilt the connection struct but omitted frame_queue, leaving it nil (its defstruct default). A frame queued before the new websocket handshake completed (e.g. an application-level ping firing in the connected-but-not-yet-handshaked window) prepended onto nil, producing an improper list [frame | nil]. The :done flush then ran Enum.reverse/1 over it and crashed (FunctionClauseError / ArgumentError "not a proper list"), killing the connection process. Reset frame_queue to [] in the reconnect rebuild, matching response_queue and init/1, so the queue is always a proper list. Adds a regression test: a /slow_websocket route widens the handshake window so pings deterministically queue during a reconnect; the client must survive the flush and keep serving traffic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
This pull request is an attempt to fix currently unhandled scenario when we have incoming frames before the Websocket connection is being established.
The error stacktrace: