GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: decode array stream headers across chunk boundaries by liuyinchu · Pull Request #298 · msgpack/msgpack-javascript

Conversation

@liuyinchu

@liuyinchu liuyinchu commented Oct 30, 2026

Copy link
Copy Markdown

Problem

decodeArrayStream() reads the outer array header outside its incomplete-data handling block. An array16 or array32 length field split across stream chunks therefore raises a RangeError before the remaining bytes can arrive.

This also affects canonical encoder output: encode an array of 16 objects, yield its first byte in one chunk, and yield the rest in the next chunk. Decoding the same bytes in one chunk succeeds.

Change

  • Read the outer array header inside the existing resumable decoding block.
  • Keep the header pending until its length field has been read completely.
  • Reject streams that end before the array header is complete.

Tests cover every split inside array16/array32 headers, byte-at-a-time input with empty chunks and non-zero view offsets, nested values, and truncated headers. No other stream validation behavior is changed intentionally.

Validation

  • Regression tests on the base revision: 4 failed, 2 passed.
  • Patched full Node suite: 333 passed.
  • ESLint and TypeScript checks passed.
  • A separate AI reviewer reran the array-stream tests: 15 passed.
  • Browser execution could not start in the test environment because Chromium socket creation was denied; Deno/Bun/Firefox were not run.

AI assistance

This patch, tests, and draft were prepared with OpenAI Codex assistance and independently reviewed by another AI agent. The test results above are from executed checks; this does not claim a human code review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
liuyinchu added 2 commits October 30, 2026 01:42
@liuyinchu
fix: resume array headers across stream chunks
f5251e0
@liuyinchu
test: cover fragmented and truncated array headers
c60ac58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@liuyinchu
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.