-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unary response with message and status in the trailers #786
Comments
Reference thread: grpc/grpc#12824 (comment) |
Should the message be discarded too, in this case? I would consider such a response being generated from an ill-behaved server or is there any legit case for servers to generate the error following the response message? |
Yes the message should be discarded if the status is non-OK, according to the link above. I can't quite actually do it though, (i.e. have a server return both a message and a non-OK status) outside of a unit-test setting. But I only tried Ruby and Node server - there seems to be no way to send both a message and a non-OK status. It may be possible for other languages though. I approached this from the unit-test perspective. |
I believe there is an issue in the gRPC-Web JavaScript client. When a unary response is returned with a message AND a non-OK status in the trailers then the JavaScript client assumes the call was successful. The JavaScript client assumes the call is successful because there is a message and doesn't check for a status in trailers.
The client should be updated to check for a non-OK status in trailers when processing unary calls.
The text was updated successfully, but these errors were encountered: