Skip to content

bugfix: unexpected output when decoding maps with long keys#1870

Open
andrewyang96 wants to merge 2 commits into
protobufjs:masterfrom
andrewyang96:map-long-key-fix
Open

bugfix: unexpected output when decoding maps with long keys#1870
andrewyang96 wants to merge 2 commits into
protobufjs:masterfrom
andrewyang96:map-long-key-fix

Conversation

@andrewyang96

Copy link
Copy Markdown

protobuf.js version: 7.2.2

Resolves #1203

As illustrated in the attached test, {"1":"2"} is transformed into {"\x01\x00\x00\x00\x00\x00\x00\x00":2} without the decoder fix. Applying util.longToHash to the long key value here isn't necessary

@derickweng

Copy link
Copy Markdown

can anyone helps review that bugfix please?

derickweng

This comment was marked as duplicate.

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.

Constructing map<int64, ...> using longHash as keys doesn't yield correct proto on the wire

2 participants