Skip to content

fix(engine.io-parser): respect binary view boundaries in browsers - #5583

Open
minjungsung wants to merge 1 commit into
socketio:mainfrom
minjungsung:fix/browser-binary-view-bounds
Open

minjungsung wants to merge 1 commit into
socketio:mainfrom
minjungsung:fix/browser-binary-view-bounds

Conversation

@minjungsung

Copy link
Copy Markdown

Browser binary decoding currently returns the entire backing buffer for a typed-array view. For example, decoding Uint8Array.of(1, 2, 3, 4).subarray(1, 3) with binaryType: 'arraybuffer' returns all four bytes instead of [2, 3]. This also affects WebTransport payload chunks that are views into a larger buffer.

Return only the view's byte range when its offset or length differs from the backing buffer. Keep the existing buffer for full-span views. Add shared regressions covering offset views, prefix views, empty views, and full-span views.

Validation: three browser regressions fail before the fix. All 32 browser tests pass afterward in headless Chrome, and the complete engine.io-parser workspace test command passes (format, both TypeScript builds, Node tests).

AI assistance: implementation, tests, and this description were prepared with Codex.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 00:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants