mirror of https://github.com/grpc/grpc-node.git
grpc-js: Rearrange some function calls to revert event order changes
This commit is contained in:
parent
210967ffa3
commit
07ee52acb0
|
@ -200,11 +200,11 @@ export class ServerWritableStreamImpl<RequestType, ResponseType>
|
|||
}
|
||||
|
||||
_final(callback: Function): void {
|
||||
callback(null);
|
||||
this.call.sendStatus({
|
||||
...this.pendingStatus,
|
||||
metadata: this.pendingStatus.metadata ?? this.trailingMetadata,
|
||||
});
|
||||
callback(null);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
@ -273,11 +273,11 @@ export class ServerDuplexStreamImpl<RequestType, ResponseType>
|
|||
}
|
||||
|
||||
_final(callback: Function): void {
|
||||
callback(null);
|
||||
this.call.sendStatus({
|
||||
...this.pendingStatus,
|
||||
metadata: this.pendingStatus.metadata ?? this.trailingMetadata,
|
||||
});
|
||||
callback(null);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
|
|
@ -842,7 +842,6 @@ export class BaseServerInterceptingCall
|
|||
if (this.checkCancelled()) {
|
||||
return;
|
||||
}
|
||||
this.notifyOnCancel();
|
||||
|
||||
trace(
|
||||
'Request to method ' +
|
||||
|
@ -869,8 +868,11 @@ export class BaseServerInterceptingCall
|
|||
};
|
||||
|
||||
this.stream.sendTrailers(trailersToSend);
|
||||
this.notifyOnCancel();
|
||||
});
|
||||
this.stream.end();
|
||||
} else {
|
||||
this.notifyOnCancel();
|
||||
}
|
||||
} else {
|
||||
if (this.callEventTracker && !this.streamEnded) {
|
||||
|
@ -886,6 +888,7 @@ export class BaseServerInterceptingCall
|
|||
...status.metadata?.toHttp2Headers(),
|
||||
};
|
||||
this.stream.respond(trailersToSend, { endStream: true });
|
||||
this.notifyOnCancel();
|
||||
}
|
||||
}
|
||||
startRead(): void {
|
||||
|
|
Loading…
Reference in New Issue