golang / protobuf

Go support for Google's protocol buffers
BSD 3-Clause "New" or "Revised" License
9.64k stars 1.58k forks source link

AllowErrors option for UnmarshalOptions #1574

Closed ekubyshin closed 7 months ago

ekubyshin commented 8 months ago

Is your feature request related to a problem? Please describe. I have a message like

message Request {
      repeated Event = 1;
}
message Event {
     optional int64 someField = 1;
     int64 otherField = 2;
}

If there're several events in the request and if one of them have an error, for instance in someField, the request will be failed. But it would be better, to have an option to ignore fields with errors, like AllowPartial and DiscurdUnknown options in UnmarshallOptions.

Describe the solution you'd like Check this pull request https://github.com/protocolbuffers/protobuf-go/pull/29

puellanivis commented 8 months ago

This is kind of a complicated process. Let’s presume that the stream loses a byte from the data. At this point all data following that lost bit is going to be garbage. This is part of the trouble with a non-self-correcting encoding.

ekubyshin commented 7 months ago

You are right. I have to send this issue to the protobuf-go team instead

puellanivis commented 7 months ago

This is the issue board for the protobuf-go project as well. In fact that repo doesn’t even have an Issues tab, because issues are handled here.