fix(protobuf): deserialize bytes fields as Uint8Array instead of Array#20
Merged
Conversation
Contributor
|
Thank you @42arch for the fix! Switching protobufjs |
joaner
added a commit
that referenced
this pull request
Jul 3, 2026
Includes protobuf bytes deserialization fix from #20.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In
parseChannel.ts,protobufjswas configured with the optionbytes: Arrayduring deserialization. This converted all binary fields (e.g.,datainfoxglove.CompressedImage) into JavaScript arrays of numbers. This broke theinstanceof Uint8Arrayvalidation checks in the Image Panel's message handlers, preventing image topics in protobuf-encoded MCAP files (like NuScenes) from rendering. Change the configuration option tobytes: Uint8Arrayto 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
Checklist
npm run lintpasses with no errorsnpm testpasses (unit tests)npm run buildandnpm run build:libsucceedAPI compatibility
N/A
Screenshots / recordings
Before:

After:
