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
In a kind of special case when oneof contains both a primitive field and a message, fromObject that is run on the instance of the static object would break the oneof by populating the primitive field with its default value.
Upd. - after some thinking, it does not really matter if a oneof has a mix of primitive and non-primitive types; .fromObject will still do the wrong thing by assigning all oneof members a value.
Upd. - this only happens when a .fromObject method of a dynamically generated class is applied to an instance of a statically generated class (produced by pbjs).
protobuf.js v6.10.2
In a kind of special case when
oneof
contains both a primitive field and a message,fromObject
that is run on the instance of the static object would break theoneof
by populating the primitive field with its default value.Example:
test.proto
repro.js
Commands to reproduce:
Result:
Note that it work properly when
fromObject
is applied to a plain object:(I'm going to look into this, filing an issue just in case)
The text was updated successfully, but these errors were encountered: