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
Version of mu: 0.23.0
Used dependencies: mu-rpc-service, mu-rpc-server.
Description:
Clients generated by mu appear to incorrectly unmarshal enum values that are assigned to 0. More specifically, such values will be interpreted as None by the client, making it impossible to distinguish them from unknown or invalid values. However, servers seem to behave as expected.
Sending a request to the server with the "value" field equal to 0 (TestEnum.Option1).
Result via BloomRPC: server correctly logs "Some(Option1)", client correctly interprets Option1 in the response. Result via a mu client: server correctly logs "Some(Option1), client incorrectly logs "None" (expected "Some(Option1)")
Sending a request to the server with the "value" field equal to 1 (TestEnum.Option2).
Result via BloomRPC: server correctly logs "Some(Option2)", client correctly interprets Option1 in the response.
Sending a request to the server with the "value" field equal to 2 (invalid enum value).
Result via BloomRPC: server correctly logs "None", client correctly interprets Option1 in the response.
Changing TestEnum.Option1 to TestEnum.Option2 in the first scenario makes it behave as expected, so this issue only affects enum values assigned to 0.
The text was updated successfully, but these errors were encountered:
Providing a custom reader via PBScalarValueReader yielded no result. It receives zero just fine and transforms it to the correct enum value, but the end result is still None for some reason.
Providing a custom PBFieldReader[Option[ExampleEnum]] seems to do the trick, so there's at least a workaround. One can place it in a package object in the same package which contains generated sources.
Version of mu:
0.23.0
Used dependencies:
mu-rpc-service
,mu-rpc-server
.Description:
Clients generated by
mu
appear to incorrectly unmarshal enum values that are assigned to 0. More specifically, such values will be interpreted asNone
by the client, making it impossible to distinguish them from unknown or invalid values. However, servers seem to behave as expected.Example:
Sending a request to the server with the "value" field equal to 0 (
TestEnum.Option1
).Result via BloomRPC: server correctly logs "Some(Option1)", client correctly interprets
Option1
in the response.Result via a
mu
client: server correctly logs "Some(Option1), client incorrectly logs "None" (expected "Some(Option1)")Sending a request to the server with the "value" field equal to 1 (
TestEnum.Option2
).Result via BloomRPC: server correctly logs "Some(Option2)", client correctly interprets
Option1
in the response.Sending a request to the server with the "value" field equal to 2 (invalid enum value).
Result via BloomRPC: server correctly logs "None", client correctly interprets
Option1
in the response.Changing
TestEnum.Option1
toTestEnum.Option2
in the first scenario makes it behave as expected, so this issue only affects enum values assigned to 0.The text was updated successfully, but these errors were encountered: