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

Cancel the pending notify timeout when stopping a query #7935

Conversation

hollandThomas
Copy link
Contributor

The original stop method does not clear the pending notifyTimeout. When a query is stopped in the same tick and right after a cache update sets the notifyTimeout, the query is not removed correctly, as the notifyTimeout callback will recreate the QueryInfo. This might lead to undesired behavior, as queries are executed that should have been stopped already.

I could not find a suitable test to extend / was unsure how to add a new test for this.

Might be related to #6888

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@apollo-cla
Copy link

@hollandThomas: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

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

Makes sense; thanks @hollandThomas!

@benjamn benjamn force-pushed the fix-clearTimeout-in-QueryManager-removeQuery branch from 25d6df8 to 69050d7 Compare April 5, 2021 15:22
@benjamn benjamn merged commit 1d441ce into apollographql:main Apr 5, 2021
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants