Skip to content

fix: use msgpack binary headers#13

Merged
lalinsky merged 1 commit intolalinsky:mainfrom
banteg:fix/binary-msgpack-main
Apr 30, 2026
Merged

fix: use msgpack binary headers#13
lalinsky merged 1 commit intolalinsky:mainfrom
banteg:fix/binary-msgpack-main

Conversation

@banteg
Copy link
Copy Markdown
Contributor

@banteg banteg commented Apr 30, 2026

Summary

  • encode binary values with MessagePack bin8/bin16/bin32 headers
  • decode binary values from bin headers while still accepting string headers
  • route Unpacker.readBinary() through the binary decoder
  • make the Binary wrapper test exercise Binary instead of String

Bug

The binary helpers were using MessagePack string headers (fixstr/str8/str16/str32) instead of the binary header family (bin8/bin16/bin32). As a result, packBinary() produced values tagged as strings, and unpackBinary() could not read correctly tagged binary payloads from other MessagePack implementations.

The public Unpacker.readBinary() method had the same issue because it called unpackString() instead of unpackBinary(). The existing "Binary struct" test did not catch this because it accidentally encoded and decoded String, not Binary.

This keeps decode compatibility for previously string-tagged binary bytes by continuing to accept string headers in unpackBinaryHeader(), but new binary encodes now use the MessagePack binary tags.

Tests

  • env PATH=/Users/banteg/.cache/zig/toolchains/zig-aarch64-macos-0.15.1:$PATH ./check.sh --ci

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@banteg has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 40 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f175552-6510-45cf-a33e-a4d79426ed8a

📥 Commits

Reviewing files that changed from the base of the PR and between ca0f153 and 4c5b061.

📒 Files selected for processing (3)
  • src/any.zig
  • src/binary.zig
  • src/msgpack.zig
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 34 minutes and 40 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@lalinsky
Copy link
Copy Markdown
Owner

Oh wow. How did i mess this up? Thank you.

@lalinsky lalinsky merged commit bc55b9d into lalinsky:main Apr 30, 2026
2 of 3 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