-
Notifications
You must be signed in to change notification settings - Fork 102
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
nested packed enums not handled properly #69
Comments
The issue is here. https://github.com/mapbox/pbf/blob/master/compile.js#L270 if (enumValues && !field.repeated) I have a fix and test on a fork that I forgot about. I'll submit a PR tomorrow. |
@kjvalencik thanks for such a quick fix! |
Not entirely. The default value is fine now, but the data is still read via an One cause seems to be the Here's a very rough patch that works for me and passes all tests (no guarantees, though): tyrasd@4591228 |
Thanks @tyrasd. Can you give this branch a try? https://github.com/mapbox/pbf/tree/kv/fix-repeated-enums |
Yes, the solution in #71 works for me. Thanks! |
Released as 3.0.4. |
I'm trying to read a pbf with a packed repeated enum field (as defined here. The compiled pbf parser seems odd for that field:
Shouldn't the default value for the
types
field be an empty array[]
(instead of0
), and the data be read via something likepbf.readPackedVarint(obj.types);
(instead ofobj.types.push(pbf.readVarint());
)?The text was updated successfully, but these errors were encountered: