-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty strings read as undefined in Map fields #1293
Comments
paambaati
changed the title
Empty strings read as undefined
Empty strings read as undefined in Map fields
Sep 11, 2019
This might be related to #843 and or #960. @rom1504 @GaloisGirl @dcodeIO @mkosieradzki Thoughts? |
Quite possible. There is no solution to this problem yet though afaik |
I'm not sure where exactly the issue lies, so I've also created a new issue on protocolbuffers/protobuf-javascript#43. |
#1348 should fix this. |
protocolbuffers/protobuf#1348 was merged. Can this be closed, @paambaati? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
protobuf.js version:
5.0.3
and6.8.8
A Go-written message has an empty string as a
map
value, but the Node version fails when deserializing it because it sees it asundefined
.Proto file — https://github.com/liftbridge-io/liftbridge-grpc/blob/5694b15f251d2ff16d7d4c3e8d944aab327d3ef0/api.proto#L93-L104
The value for a
Message
on the Go side looks like this —Reproduction steps
docker run -p 4222:4222 -ti nats:latest --debug --trace
in a window.go get github.com/liftbridge-io/go-liftbridge
and then$GOPATH/bin/liftbridge --raft-bootstrap-seed --nats-servers nats://localhost:4222 --level debug
in another window.https://github.com/paambaati/node-liftbridge.git
in yet another window.yarn install
ornpm install
yarn run debug
ornpm run debug
When trying to read this message on the Node.js side, I get this error —
Specifically, this happens when the header value for key "reply" is read. Printing the values
f
andg
in the below snippet prints"reply"
forf
andundefined
forg
, when one would expect it to be""
(an empty string).Related issues
The text was updated successfully, but these errors were encountered: