grpc-js: Undo changes to stream tracking

This commit is contained in:
Michael Lumish 2023-01-12 10:00:28 -08:00
parent fade30bd0a
commit 7eaebaf1ed
1 changed files with 2 additions and 1 deletions

View File

@ -198,7 +198,6 @@ export class Http2SubchannelCall implements SubchannelCall {
* we can bubble up the error message from that event. */
process.nextTick(() => {
this.trace('HTTP/2 stream closed with code ' + http2Stream.rstCode);
this.callEventTracker.onStreamEnd(this.finalStatus?.code === Status.OK);
/* If we have a final status with an OK status code, that means that
* we have received all of the messages and we have processed the
* trailers and the call completed successfully, so it doesn't matter
@ -289,6 +288,7 @@ export class Http2SubchannelCall implements SubchannelCall {
);
this.internalError = err;
}
this.callEventTracker.onStreamEnd(false);
});
}
@ -403,6 +403,7 @@ export class Http2SubchannelCall implements SubchannelCall {
}
private handleTrailers(headers: http2.IncomingHttpHeaders) {
this.callEventTracker.onStreamEnd(true);
let headersString = '';
for (const header of Object.keys(headers)) {
headersString += '\t\t' + header + ': ' + headers[header] + '\n';