Skip to content

fix(protobuf): deserialize bytes fields as Uint8Array instead of Array#20

Merged
joaner merged 1 commit into
ioai-tech:mainfrom
42arch:fix-image-protobuf
Jul 3, 2026
Merged

fix(protobuf): deserialize bytes fields as Uint8Array instead of Array#20
joaner merged 1 commit into
ioai-tech:mainfrom
42arch:fix-image-protobuf

Conversation

@42arch

@42arch 42arch commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

In parseChannel.ts, protobufjs was configured with the option bytes: Array during deserialization. This converted all binary fields (e.g., data in foxglove.CompressedImage) into JavaScript arrays of numbers. This broke the instanceof Uint8Array validation checks in the Image Panel's message handlers, preventing image topics in protobuf-encoded MCAP files (like NuScenes) from rendering. Change the configuration option to bytes: Uint8Array to preserve raw binary buffers and allow correct rendering of protobuf-based images.

Motivation / related issue

As shown in the screenshots, if the image topic in the MCAP file uses Protobuf encoding, it will not be rendered in the ImagePanel. Other topics using ROS1 or CDR (ROS 2) encoding are not affected.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • npm run lint passes with no errors
  • npm test passes (unit tests)
  • npm run build and npm run build:lib succeed
  • New behavior is covered by tests (or explain why tests aren't applicable)
  • Documentation updated (README, API.md, EMBEDDING.md) if the public API changed
  • Breaking change: all affected call sites updated and migration path described in PR description

API compatibility

N/A

Screenshots / recordings

Before:
before

After:
after

@joaner joaner merged commit 6d52f83 into ioai-tech:main Jul 3, 2026
2 checks passed
@joaner

joaner commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Thank you @42arch for the fix!

Switching protobufjs bytes deserialization to Uint8Array correctly restores Image Panel rendering for protobuf-encoded MCAP image topics. Great catch with a minimal, targeted change.

joaner added a commit that referenced this pull request Jul 3, 2026
Includes protobuf bytes deserialization fix from #20.
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