Skip to content

grpc-js: Rearrange some function calls to revert event order changes#2683

Merged
murgatroid99 merged 1 commit intogrpc:@grpc/grpc-js@1.10.xfrom
murgatroid99:grpc-js_server_event_order
Mar 7, 2024
Merged

grpc-js: Rearrange some function calls to revert event order changes#2683
murgatroid99 merged 1 commit intogrpc:@grpc/grpc-js@1.10.xfrom
murgatroid99:grpc-js_server_event_order

Conversation

@murgatroid99
Copy link
Copy Markdown
Member

This fixes #2681, according to manual testing. The goal is to ensure that the cancelled event is emitted after the finish event. First, in sendStatus, the notifyOnCancel call is moved to after actually sending the status. The most important part of that is moving it into the wantTrailers event handler, so that it is only called after the stream is flushed, but it also needs to be in the other branches in that function. In addition, the callback in the _final implementations is moved to before the sendStatus call to get the right ordering if there is a trailers-only response, which will be sent synchronously.

@murgatroid99 murgatroid99 merged commit 55b9852 into grpc:@grpc/grpc-js@1.10.x Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants