Skip to content

Propagate falsy extension errors from incremental decoders - #170

Merged
kawanet merged 1 commit into
kawanet:mainfrom
Aschenbath:fix/oss-20-more-20261125-77d1-msgpack-unpacker-errors
Nov 27, 2026
Merged

kawanet merged 1 commit into
kawanet:mainfrom
Aschenbath:fix/oss-20-more-20261125-77d1-msgpack-unpacker-errors

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

When a custom extension unpacker throws a falsy value, msgpack.decode() propagates it, but Decoder.decode() silently treats the same failure as a buffer shortage. The input is rolled back and the caller sees neither the decoded value nor the failure.

Only treat the existing BUFFER_SHORTAGE sentinel as incomplete input. Other thrown values now propagate unchanged. The regression compares both public decoding APIs for false, 0, "", null, undefined and NaN; a fragmented extension payload remains a passing control.

Validation on Windows, Node.js 24.22.0:

  • On unchanged source, the new exception regression fails; the other three decoder tests pass.
  • All 205 Node tests pass after the fix.
  • JSHint, the deprecation-silence check, browser build/minification (under the size cap), and browser-global/CommonJS bundle smoke checks pass. These Makefile prerequisites were executed directly because make is unavailable on this host.

Assisted by OpenAI Codex; the change and regression were reviewed and tested.

@kawanet-bot kawanet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@kawanet
kawanet merged commit 2b3a771 into kawanet:main Nov 27, 2026
6 checks passed
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