Skip to content
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

Extra fields in a message causes decode to throw an error #36

Closed
roberthunt opened this issue Jul 1, 2013 · 2 comments
Closed

Extra fields in a message causes decode to throw an error #36

roberthunt opened this issue Jul 1, 2013 · 2 comments

Comments

@roberthunt
Copy link

I'm working with a protobuf schema which is changing over time, additional optional fields are being added to the message definitions but the parser doesn't seem to be able to handle them.

The Google Protobuf Language Guide (https://developers.google.com/protocol-buffers/docs/proto#updating) explains "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing." I understand that there is no requirement for this library to obey these guidelines but it would be nice if it could handle this case instead of falling over with an exception.

I'm using ProtoBuf.noparse.js and the error is coming from line 1012: throw(new Error("Illegal field id in "+this.toString(true)+"#decode: "+id));

Is this something that could be added?

Thanks

@ghost ghost assigned dcodeIO Jul 1, 2013
@dcodeIO dcodeIO closed this as completed in 3e997ce Jul 1, 2013
@dcodeIO
Copy link
Member

dcodeIO commented Jul 1, 2013

Thanks for reporting this! It's fixed in 1.0.3.

@roberthunt
Copy link
Author

Great, thanks for the quick response/resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants