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

Polling does not stop after unmounting query #11750

Open
dylanwulf opened this issue Apr 2, 2024 · 2 comments · May be fixed by #11837
Open

Polling does not stop after unmounting query #11750

dylanwulf opened this issue Apr 2, 2024 · 2 comments · May be fixed by #11837
Labels

Comments

@dylanwulf
Copy link
Contributor

Issue Description

When I mount a polling query and then later unmount it, I would expect the polling to stop. But instead the polling seems to continue.

Link to Reproduction

https://github.com/dylanwulf/react-apollo-error-template/tree/polling-doesnt-stop

Reproduction Steps

  • Start my reproduction on branch polling-doesnt-stop
  • Open the console
  • Click the "Toggle Polling" button to start polling
  • See the polling query log to the console
  • Click the "Toggle Polling" button again to stop polling
  • See that the polling query continues being logged to the console

@apollo/client version

tried 3.7.12 & 3.9.9, problem exists in both

@jerelmiller
Copy link
Member

Thanks for the report @dylanwulf! We've got 3.10 in rc that we'll be releasing next week. We'll see if we can take a look at this sometime after that goes out 🙂

@jerelmiller
Copy link
Member

Hey @dylanwulf 👋

I've got a fix for this issue in #11837. Thanks so much for your reproduction which helped me narrow down the issue here!

I can confirm that installing the snapshot release fixes this issue. If you'd like to try it yourself, you can install it with the following command:

npm i @apollo/client@0.0.0-pr-11837-20240509172621

We should be able to get this out with the next patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants