Skip to content

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

Merged
darrachequesne merged 1 commit into
socketio:mainfrom
minjungsung:fix/browser-binary-view-bounds
Nov 3, 2026
Merged

darrachequesne merged 1 commit into
socketio:mainfrom
minjungsung:fix/browser-binary-view-bounds

Conversation

@minjungsung

Copy link
Copy Markdown
Contributor

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.

@darrachequesne
darrachequesne merged commit 47c3aa7 into socketio:main Nov 3, 2026
10 checks passed
@darrachequesne

Copy link
Copy Markdown
Member

Nice, thanks 👍

@darrachequesne

Copy link
Copy Markdown
Member

Actually, I don't think this is needed, as WebTransport always returns Uint8Array. What do you think?

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.

3 participants