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

Fix unhandledRejection when aborting a server stream using @bufbuild/connect-node #530

Merged
merged 2 commits into from Mar 15, 2023
Merged

Conversation

ghost
Copy link

@ghost ghost commented Mar 13, 2023

Hello ! 😄

I think I have solved the issue #476. If I understood correctly, the call sentinel.finally() returns a new Promise, whose failure was never catched.

However, I am not sure that ignoring the error is the right solution. I have the impression that the sentinel.catch() earlier in the code makes it safe to do so, but am I wrong?

Thank you very much in advance!

@CLAassistant
Copy link

CLAassistant commented Mar 13, 2023

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Johyn Papin <contact@johyn.me>
@timostamm timostamm changed the title Fix #476 Fix unhandledRejection when aborting a server stream using @bufbuild/connect-node Mar 14, 2023
Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great spot!

However, I am not sure that ignoring the error is the right solution. I have the impression that the sentinel.catch() earlier in the code makes it safe to do so, but am I wrong?

Yes, that's correct. Any errors should propagate through the response (body).

packages/connect-node/src/node-universal-client.ts Outdated Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Mar 15, 2023

Sorry for the forced push, I made a mistake in the commit message...

Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@timostamm timostamm merged commit 716b043 into connectrpc:main Mar 15, 2023
This was referenced Mar 15, 2023
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.

None yet

2 participants