-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
useQuery pollInterval with cache-and-network doesn't stop to make requests after unmounting a component #9431
Comments
Have the same problem |
Ran into the same issue |
Problem still exists |
We are hitting this issue but it seems like it's only in strict-mode. When in production it doesn't seem to keep the queries running after unmounting. We are on version |
Same here. |
Ran into this as well. In our case it was something like { isEnabled ? (<ComponentA/> ) : (<ComponentB/>) } and each component had a pollInterval with the |
Hey all 👋 Would anybody be able to share a minimal reproduction of this issue? I've attempted to reproduce this with our tests but have been unsuccessful. Both strict mode and non-strict mode seem to stop polling as expected when the component unmounts. Take a look at https://github.com/apollographql/apollo-client/compare/jerel/cache-and-network-polling?expand=1 for my attempt to reproduce this. Any help would be appreciated recreating the issue. |
Possibly related to my issue #11750 which does have a reproduction |
Awesome, thanks @dylanwulf! |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Intended outcome: Make a request every
pollInterval
ms and stop making requests after unmounting the component.Actual outcome: Make two requests every
pollInterval
ms and doesn't stop and make a request everypollInterval
ms after unmounting the componentHow to reproduce the issue:
It works with other
fetchPolicy
but it doesn't work withcache-and-network
.Versions
^3.5.8
The text was updated successfully, but these errors were encountered: