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

Make repeated field merging consistent #335

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

jcready
Copy link
Contributor

@jcready jcready commented Jun 19, 2022

This addresses #319

Setup

const source = { bars: [1],    foos: [{ foo: 1 }] };
const target = { bars: [2, 3], foos: [{ foo: 2 }, { foo: 3 }] };
reflectionMergePartial(SomeMessageType, target, source);

Before PR

Repeated Field Scalar/Enum Message
result target array is referentially equal to original target array
result target array is deeply equal to source array
result target array is NOT referentially equal to source array

After PR

Repeated Field Scalar/Enum Message
result target array is referentially equal to original target array
result target array is deeply equal to source array
result target array is NOT referentially equal to source array

Copy link
Owner

@timostamm timostamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, James. I think it is safe to call this is a bug fix - the different behavior between repeated scalar and repeated message fields was clearly unintentional.

@timostamm timostamm merged commit 8a2d93b into timostamm:master Aug 17, 2022
@jcready jcready deleted the repeated-field-merging branch August 17, 2022 12:24
@timostamm
Copy link
Owner

Released in v2.8.0.

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