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 — Stream decoders silently accept incomplete final records · Issue #299 · msgpack/msgpack-javascript

Stream decoders silently accept incomplete final records #299

New issue
Copy link
New issue
Copy link
Open
#300
Open
Stream decoders silently accept incomplete final records#299
#300
Copy link

Description

@HocVoNgThai
HocVoNgThai
opened on Oct 31, 2026
Issue body actions

decodeArrayStream() and decodeMultiStream() finish successfully when input ends partway through the last record. The caller receives only the preceding records, although both APIs document a RangeError for incomplete data.

import { encode, decodeArrayStream } from '@msgpack/msgpack'

const bytes = encode([{ id: 1 }, { id: 2 }])
async function* input() {
  yield bytes.subarray(0, bytes.length - 1)
}

const items = []
for await (const item of decodeArrayStream(input())) items.push(item)
console.log(items) // [{ id: 1 }], with no error

Expected: iteration rejects with RangeError when the stream ends. The same issue occurs with concatenated records passed to decodeMultiStream(), and when an array declares another item but contains no bytes for it.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.