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: unhandled promise rejections during reconnect #1585

Merged
merged 8 commits into from
Nov 22, 2024

Conversation

myandrienko
Copy link
Contributor

@myandrienko myandrienko commented Nov 21, 2024

this.disconnectionPromise = this.connectionPromise
? this.connectionPromise.then(() => disconnectUser())
: disconnectUser();
this.disconnectionPromise.finally(
() => (this.disconnectionPromise = undefined),
await withoutConcurrency(this.connectionConcurrencyTag, () =>
disconnectUser(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We had a lot of this disconnectionPromise/connectionPromise chaining to make sure the two don't run at the same time. Replacing with withoutConcurrency for simplicity. Also allows us to get rid of two stored promises.

@myandrienko myandrienko force-pushed the reconnect-handle-errors branch from 67f895a to f852c78 Compare November 21, 2024 14:48
@myandrienko myandrienko marked this pull request as ready for review November 21, 2024 17:18
@myandrienko myandrienko merged commit 920c4ea into main Nov 22, 2024
15 checks passed
@myandrienko myandrienko deleted the reconnect-handle-errors branch November 22, 2024 12:28
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