Skip to content

Sync with upstream v3.1.3 + Gather patch#5

Merged
AndrewSouthpaw merged 4 commits into
main-upstreamfrom
gather-patch
May 11, 2026
Merged

Sync with upstream v3.1.3 + Gather patch#5
AndrewSouthpaw merged 4 commits into
main-upstreamfrom
gather-patch

Conversation

@AndrewSouthpaw
Copy link
Copy Markdown

@AndrewSouthpaw AndrewSouthpaw commented May 10, 2026

Rebases our allowUndefinedCustomEncoding patch onto upstream v3.1.3.

The PR diff shows only Gather-specific changes against the upstream baseline (main-upstream = exact v3.1.3 tag):

  • src/Encoder.ts — the allowUndefinedCustomEncoding option (5 insertions)
  • package.json — rename to @gathertown/msgpack, version 3.1.3

Original patch for comparison: #2

All 325 upstream tests pass.

Test Plan

  • npm test passes (325/325)

Note

Medium Risk
Changes how undefined is treated during encoding when allowUndefinedCustomEncoding is enabled, which can affect on-the-wire serialization compatibility. Adds targeted tests, but consumers relying on default undefined→nil behavior should review usage.

Overview
Renames the published package to @gathertown/msgpack while keeping version 3.1.3.

Adds an opt-in Encoder option, allowUndefinedCustomEncoding, that stops treating undefined as MessagePack nil so extension codecs can custom-encode it; ensures this flag is preserved across encoder clone() reentrancy. Updates ExtensionCodec tests to cover encoding/decoding undefined and the clone-propagation case.

Reviewed by Cursor Bugbot for commit f04adc1. Bugbot is set up for automated code reviews on this repo. Configure here.

Allows extension codecs to handle undefined values instead of
msgpack converting them to nil. Used by Gather's serialization
framework to preserve {a: undefined} round-trip fidelity.
Ports the undefined round-trip test from the original patch PR and adds
a new reentrancy test verifying that allowUndefinedCustomEncoding is
propagated through clone() when the encoder's reentrance guard fires.
The encoder variable was only assigned once; restructuring to declare it
before the Box codec registration lets ESLint's prefer-const rule pass
while keeping the test semantics identical (extensionCodec is a shared
reference, so the Box codec registered afterward is still visible to the
encoder at runtime).
@AndrewSouthpaw AndrewSouthpaw merged commit 9b3956c into main-upstream May 11, 2026
22 of 26 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.

2 participants