-
Notifications
You must be signed in to change notification settings - Fork 349
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: Add missing defaults to fromPartial if options.oneof is UNIONS #375
Conversation
@@ -248,6 +264,8 @@ export const PleaseChoose = { | |||
} | |||
if (object.age !== undefined && object.age !== null) { | |||
message.age = object.age; | |||
} else { | |||
message.age = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same code as in oneof-properties now
} else { | ||
message.signature = new Uint8Array(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change, those 3 lines were missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I added you as a collaborator, so feel free to merge and it should auto-release.
Thanks! But it says Only those with write access to this repository can merge pull requests. and I don't get a Mergie button or automerge option. |
Nevermind, I just had to accept the invitation. |
## [1.83.2](v1.83.1...v1.83.2) (2021-10-26) ### Bug Fixes * Add missing defaults to fromPartial if options.oneof is UNIONS ([#375](#375)) ([21781e9](21781e9))
🎉 This PR is included in version 1.83.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Before this change, setting
options.oneof
toUNIONS
would cause that the else block infromPartial
was never written, no matter if the field is part of the oneof or not. To illustrate, a simplebytes signature
field was added to oneof-unions, which requires anelse
case to be properly initialized. With the change inmain.ts
, the missing code is now generated.