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 {
|
_final(callback: Function): void {
|
||||||
|
callback(null);
|
||||||
this.call.sendStatus({
|
this.call.sendStatus({
|
||||||
...this.pendingStatus,
|
...this.pendingStatus,
|
||||||
metadata: this.pendingStatus.metadata ?? this.trailingMetadata,
|
metadata: this.pendingStatus.metadata ?? this.trailingMetadata,
|
||||||
});
|
});
|
||||||
callback(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
@ -273,11 +273,11 @@ export class ServerDuplexStreamImpl<RequestType, ResponseType>
|
||||||
}
|
}
|
||||||
|
|
||||||
_final(callback: Function): void {
|
_final(callback: Function): void {
|
||||||
|
callback(null);
|
||||||
this.call.sendStatus({
|
this.call.sendStatus({
|
||||||
...this.pendingStatus,
|
...this.pendingStatus,
|
||||||
metadata: this.pendingStatus.metadata ?? this.trailingMetadata,
|
metadata: this.pendingStatus.metadata ?? this.trailingMetadata,
|
||||||
});
|
});
|
||||||
callback(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|
|
@ -842,7 +842,6 @@ export class BaseServerInterceptingCall
|
||||||
if (this.checkCancelled()) {
|
if (this.checkCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.notifyOnCancel();
|
|
||||||
|
|
||||||
trace(
|
trace(
|
||||||
'Request to method ' +
|
'Request to method ' +
|
||||||
|
@ -869,8 +868,11 @@ export class BaseServerInterceptingCall
|
||||||
};
|
};
|
||||||
|
|
||||||
this.stream.sendTrailers(trailersToSend);
|
this.stream.sendTrailers(trailersToSend);
|
||||||
|
this.notifyOnCancel();
|
||||||
});
|
});
|
||||||
this.stream.end();
|
this.stream.end();
|
||||||
|
} else {
|
||||||
|
this.notifyOnCancel();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.callEventTracker && !this.streamEnded) {
|
if (this.callEventTracker && !this.streamEnded) {
|
||||||
|
@ -886,6 +888,7 @@ export class BaseServerInterceptingCall
|
||||||
...status.metadata?.toHttp2Headers(),
|
...status.metadata?.toHttp2Headers(),
|
||||||
};
|
};
|
||||||
this.stream.respond(trailersToSend, { endStream: true });
|
this.stream.respond(trailersToSend, { endStream: true });
|
||||||
|
this.notifyOnCancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startRead(): void {
|
startRead(): void {
|
||||||
|
|
Loading…
Reference in New Issue