Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

murgatroid99
Copy link
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
4 of 5 checks passed
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