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
Scalar fields like bool, int, string (...etc) have default values (False, 0, “”), however , at the receiving end you cannot tell whether a field was intentionally set to the default...
I posted my frustrations in a long standing issue here: protocolbuffers/protobuf#359
(This changed with proto2 => proto3)
This means things like latestMessage, isHeldTotal, port (etc..) have to either always send the data value from UIS data-store or only send the non-default... Unacceptable, as there’s no option in proto3 to have alternate defaults...
With the protoc run with option --experimental_allow_proto3_optional..
This is suppose to be available via release from 3.12 or later..
I don’t think it’ll be hard to change (heck we could probably even pickle GraphQL ObjectTypes if we wanted or just use dict)..
This issue came to light when working with the delta subscription PRs: #3500 cylc/cylc-uiserver#118
And can be addressed at any point with option 1) (and the availability of protobuf=3.12.*), however anything more drastic should wait until after they go in.
Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read CONTRIBUTING.md before starting any work though).
The text was updated successfully, but these errors were encountered:
Problem:
(from Riot)
Scalar fields like bool, int, string (...etc) have default values (False, 0, “”), however , at the receiving end you cannot tell whether a field was intentionally set to the default...
For example:
I posted my frustrations in a long standing issue here:
protocolbuffers/protobuf#359
(This changed with proto2 => proto3)
This means things like
latestMessage
,isHeldTotal
,port
(etc..) have to either always send the data value from UIS data-store or only send the non-default... Unacceptable, as there’s no option in proto3 to have alternate defaults...I/we don’t want clunky workarounds..
Solution(s):
default values and testing if a field is set in v3 protocolbuffers/protobuf#359 (comment)
and referenced an upcoming release feature to fix this:
https://github.com/protocolbuffers/protobuf/blob/master/docs/field_presence.md
(which looks like it's in
master
)With the
protoc
run with option--experimental_allow_proto3_optional
..This is suppose to be available via release from 3.12 or later..
This issue came to light when working with the delta subscription PRs:
#3500
cylc/cylc-uiserver#118
And can be addressed at any point with option 1) (and the availability of
protobuf=3.12.*
), however anything more drastic should wait until after they go in.Pull requests welcome!
This is an Open Source project - please consider contributing a bug fix
yourself (please read
CONTRIBUTING.md
before starting any work though).The text was updated successfully, but these errors were encountered: