The table in the docs for gRPC status codes indicates that a "cardinality violation" -- when a stream is expected to have exactly one message and instead has zero or multiple -- should result in an "unimplemented" error code, both from clients upon observing a malformed response stream and from servers upon observing a malformed request stream.
This library was previously using "unknown" as the error code, fashioned after grpc-go, which apparently does not correctly implement this. Further, this library only validated the response stream, in the client. With this change, it uses the correct code and also validates the request stream, in the server.
The table in the docs for gRPC status codes indicates that a "cardinality violation" -- when a stream is expected to have exactly one message and instead has zero or multiple -- should result in an "unimplemented" error code, both from clients upon observing a malformed response stream and from servers upon observing a malformed request stream.
This library was previously using "unknown" as the error code, fashioned after grpc-go, which apparently does not correctly implement this. Further, this library only validated the response stream, in the client. With this change, it uses the correct code and also validates the request stream, in the server.