grpc-js: Don't push messages after ending a call

This commit is contained in:
Michael Lumish 2020-05-21 11:41:44 -07:00
parent 075a75b015
commit ed5b3ac1cd
1 changed files with 7 additions and 0 deletions

View File

@ -289,6 +289,13 @@ export class Http2CallStream implements Call {
);
this.canPush = false;
process.nextTick(() => {
/* If we have already output the status any later messages should be
* ignored, and can cause out-of-order operation errors higher up in the
* stack. Checking as late as possible here to avoid any race conditions.
*/
if (this.statusOutput) {
return;
}
this.listener?.onReceiveMessage(message);
this.maybeOutputStatus();
});