Don't send status through the filter stack twice when receiving trailers

This commit is contained in:
Michael Lumish 2021-03-04 16:34:53 -08:00
parent e3b35505a0
commit efc9a0f05c
3 changed files with 3 additions and 16 deletions

View File

@ -45,7 +45,7 @@
"@grpc/proto-loader": "^0.6.0-pre14"
},
"peerDependencies": {
"@grpc/grpc-js": "~1.2.7"
"@grpc/grpc-js": "~1.2.10"
},
"engines": {
"node": ">=10.10.0"

View File

@ -1,6 +1,6 @@
{
"name": "@grpc/grpc-js",
"version": "1.2.9",
"version": "1.2.10",
"description": "gRPC Library for Node - pure JS implementation",
"homepage": "https://grpc.io/",
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

View File

@ -442,21 +442,8 @@ export class Http2CallStream implements Call {
);
}
const status: StatusObject = { code, details, metadata };
let finalStatus;
try {
// Attempt to assign final status.
finalStatus = this.filterStack.receiveTrailers(status);
} catch (error) {
// This is a no-op if the call was already ended when handling headers.
this.endCall({
code: Status.INTERNAL,
details: 'Failed to process received status',
metadata: new Metadata(),
});
return;
}
// This is a no-op if the call was already ended when handling headers.
this.endCall(finalStatus);
this.endCall(status);
}
attachHttp2Stream(