Repository navigation
Report malformed response messages as internal on clients - #455
Draft
stefanvanburen wants to merge 1 commit into
Draft
stefanvanburen wants to merge 1 commit into
stefanvanburen wants to merge 1 commit into
Conversation
`decode_message` and `decompress` reported every malformed message as `invalid_argument`, which is right for a server reading a request but tells a client that its own request was bad when the server sent a response it can't decode. Both now take the code to report: the envelope readers pass their `_protocol_error_code`, which is already `internal` on the client and `invalid_argument` on the server, and the unary clients pass `internal`. This matches what grpc-go, connect-es, connect-rust, and connect-dart return for the cases in connectrpc/conformance#1190. Signed-off-by: Stefan VanBuren <stefan@vanburen.xyz>
stefanvanburen
force-pushed
the
svanburen/client-decode-internal
branch
from
November 20, 2026 13:16
bc03f2a to
cdb2c2d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client-side half of connectrpc/conformance#1190: a response message that fails to decode (or decompress) is now
internalon the client instead ofinvalid_argument, while servers keepinvalid_argumentfor malformed requests (connectrpc/conformance#1142). The envelope readers already had a per-side_protocol_error_codefor bad flags and truncated frames, so this just routes decode and decompress failures through it too.With this, the sync and async clients pass all 24 of connectrpc/conformance#1190's cases (up from 0). Leaving it as a draft until connectrpc/conformance#1190 settles on a code; if it lands, this should also bump the conformance version so those cases run in CI.
The
decompresschange isn't covered by connectrpc/conformance#1190 yet (it only sends uncompressed messages), so that part is only exercised bytest_reject_malformed_message[malformed-compressed]for now.