Closed IgorRSGraziano closed 2 months ago
I'm editing an external protobuf, where I don't have a mapping file, but I know I need to edit the item with tag 1. But if I write the tag, it gets duplicated, how can I remove one?
proto.writeStringField(1, preparedMsg)
After write one field, if i run
proto.readFields((tag, _, pbf) => { if (tag != 1 || !pbf) return; console.log(tag); });
i get twice log of 1
You'd have to rebuild the whole pbf from scratch. There's no "editing in place" in Protobuf.
pbf
I'm editing an external protobuf, where I don't have a mapping file, but I know I need to edit the item with tag 1. But if I write the tag, it gets duplicated, how can I remove one?
proto.writeStringField(1, preparedMsg)
After write one field, if i run
proto.readFields((tag, _, pbf) => { if (tag != 1 || !pbf) return; console.log(tag); });
i get twice log of 1