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

Fix protobuf merge when types have different descriptor instances #526

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

TristonianJones
Copy link
Collaborator

When two proto messages have different descriptor instances it's not possible
to merge from one proto to the other without raising a panic. The fallback strategy
is to merge using the proto.Marshal and proto.Unmarshal calls to serialize to bytes
first.

The existing proto.Merge semantics might benefit from relaxing their constraints,
but I can see how in some cases the merge result might be undefined.

@TristonianJones TristonianJones requested a review from jcking April 6, 2022 05:38
@TristonianJones TristonianJones merged commit 1bb0fb9 into google:master Apr 6, 2022
@TristonianJones TristonianJones deleted the pb-merge-fix branch April 6, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants