You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know for sure if this behavior is correct or incorrect, but it feels incorrect to me considering how reflectionMergePartial() treats other fields where the source field is unset:
fieldValue=input[name];// we are using the source directly
output=targetasUnknownMessage;// we want our field value to go directly into the target
if(fieldValue==undefined){
continue;// skip further work on field, existing value is used as is
}
I would not expect an unset oneof field in the source to overwrite/unset a set oneof field in the target. I believe the fix would be to update line 40 to:
- if (group == undefined) { // the user is free to omit+ if (group?.oneofKind == undefined) { // the user is free to omit
The text was updated successfully, but these errors were encountered:
jcready
added a commit
to jcready/protobuf-ts
that referenced
this issue
Nov 11, 2022
protobuf-ts/packages/runtime/src/reflection-merge-partial.ts
Lines 39 to 49 in 3eea598
I don't know for sure if this behavior is correct or incorrect, but it feels incorrect to me considering how
reflectionMergePartial()
treats other fields where the source field is unset:protobuf-ts/packages/runtime/src/reflection-merge-partial.ts
Lines 51 to 55 in 3eea598
I would not expect an unset oneof field in the source to overwrite/unset a set oneof field in the target. I believe the fix would be to update line 40 to:
The text was updated successfully, but these errors were encountered: