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

Use setTimeout instead of Promise.resolve().then(...) to delay Concast cancellation #8676

Merged
merged 3 commits into from Aug 20, 2021

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Aug 20, 2021

Inspired by @cornedor's comment #7608 (comment).

Should help with some instances of issue #7608, specifically those with global unhandled promise rejection errors.

I don't know if this is the full solution, but I believe it is helpful and safe to introduce a delay before unsubscribing from the underlying observable, giving other Concast subscribers a chance to subscribe, thereby saving the Concast from needing to be cancelled, while still quickly unsubscribing if there are no new subscribers within 10ms.

Inspired by @cornedor's comment:
#7608 (comment)

Should help with some instances of issue #7608, specifically those with
global unhandled promise rejection errors. I don't know if this is the
full solution, but I believe it is helpful and safe to introduce a delay
before unsubscribing, giving other subscribers a chance to subscribe,
thereby saving the Concast from needing to be cancelled.
src/core/QueryManager.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@brainkim brainkim left a comment

Choose a reason for hiding this comment

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

LGTM

@benjamn benjamn merged commit 684765e into main Aug 20, 2021
@benjamn benjamn deleted the use-setTimeout-to-delay-Concast-cancellation branch August 20, 2021 20:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants