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
First of all, thanks for such a cool library! But let's make it even better :)
I have encountered the same error as in #232
But in my case, on other side grpc proxy - envoy. And previous solution that i used, grpc-web + google-porotobuf, works fine with it.
This problem occurs only when stream closed by server with empty response. https://github.com/timostamm/protobuf-ts/blob/master/packages/grpcweb-transport/src/grpc-web-transport.ts#L120
Promise returned from function readGrpcWebResponseBody resolved without calling a callback (that handles trailers), because response.body has zero length.
According to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md
"3. Trailers must be the last message of the response, as enforced by the implementation"
And check for trailers and status is correct. But there is pt. 4: "Trailers-only responses: no change to the gRPC protocol spec. Trailers may be sent together with response headers, with no message in the body."
So, this is normal that response body is empty and not contain trailers, if they exists in response headers.
And in my case response headers contains header: grpc-status: 0, that could be parsed correctly.
In total, we need to fix the check for trailers and status, to resolve this case.
Soon I will try to open PR to fix this.
The text was updated successfully, but these errors were encountered:
eKazim
added a commit
to eKazim/protobuf-ts
that referenced
this issue
Jun 12, 2022
First of all, thanks for such a cool library! But let's make it even better :)
I have encountered the same error as in #232
But in my case, on other side grpc proxy - envoy. And previous solution that i used, grpc-web + google-porotobuf, works fine with it.
This problem occurs only when stream closed by server with empty response.
https://github.com/timostamm/protobuf-ts/blob/master/packages/grpcweb-transport/src/grpc-web-transport.ts#L120
Promise returned from function
readGrpcWebResponseBody
resolved without calling a callback (that handles trailers), becauseresponse.body
has zero length.According to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md
"3. Trailers must be the last message of the response, as enforced by the implementation"
And check for trailers and status is correct. But there is pt. 4: "Trailers-only responses: no change to the gRPC protocol spec. Trailers may be sent together with response headers, with no message in the body."
So, this is normal that response body is empty and not contain trailers, if they exists in response headers.
And in my case response headers contains header:
grpc-status: 0
, that could be parsed correctly.In total, we need to fix the check for trailers and status, to resolve this case.
Soon I will try to open PR to fix this.
The text was updated successfully, but these errors were encountered: