Repository navigation
Conversation
Transport EOF before the final frame is complete can silently return a partial message. Report unexpected EOF and finish the remaining framing after a DEFLATE BFINAL block so valid fragmented messages still work.
This branch has not been deployed
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.
Fixes #578.
When a connection closes during a frame payload or before the final continuation frame,
ReadandReadercan return a partial message without an error. Returnio.ErrUnexpectedEOFuntil the final frame's payload is complete.Compressed messages need the same check. A valid DEFLATE stream can end before the WebSocket message does, so consume its remaining framing and padding before returning EOF. This preserves fragmented BFINAL messages and prevents buffered padding from affecting the next message.
The 108 regression cases cover plain and compressed messages, both receiver roles, both read APIs, and complete messages followed by more messages. The unchanged base fails 76 cases; the fix passes all 108.
Verified locally:
AUTOBAHN=1suite with the repository's existing exclusions: 296 OK, 3 informational results.CI=1 go test -run ^TestWasm$passed locally on macOS arm64 with Go 1.23.12, Chrome 155 and the same pinned wasmbrowsertest revision used in CI. This runtime run disabled native vet because of the existing assembly diagnostics below.Native arm64 vet reports two existing assembly variable-name errors, also reproduced on the unchanged base.
The upstream
TestWasmjob times out starting the browser (websocket url timeout reached). The same failure is present in the unchanged-base CI run. The Linux startup failure remains unresolved; the current job does not include browser startup output to identify its cause.