Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

pollInterval on different pages on the same query keeps increasing instead of stopping #3796

Closed
chemicalkosek opened this issue Jan 13, 2020 · 2 comments

Comments

@chemicalkosek
Copy link

chemicalkosek commented Jan 13, 2020

Intended outcome:

Setting up a pollInterval on a component in one page should stop that interval when going to another page (or unmounting that component) and start a pollInterval on that new page (mounted component) for the same query.

Actual outcome:
I have a page /a with ComponentA with a useQuery for QUERY. It has a pollInterval 7000. I go to page /b with ComponentB which also has a useQuery for the same QUERY. It has also a pollInterval. I then see in Network Tab that the polling frequency increases. When I navigate even further between the pages the polling frequency can increase even more, firing every second or faster.

How to reproduce the issue:

Version
I'm using react-apollo 3.1.3 so #3485 should work

System:
OS: Linux 5.0 Ubuntu 18.04.3 LTS (Bionic Beaver)
Binaries:
Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
Browsers:
Chrome: 79.0.3945.117
Firefox: 72.0.1
npmPackages:
apollo-boost: ^0.4.7 => 0.4.7
apollo-cache-inmemory: ^1.6.5 => 1.6.5
apollo-client: ^2.6.8 => 2.6.8
apollo-link: ^1.2.13 => 1.2.13
apollo-link-error: ^1.1.12 => 1.1.12
apollo-link-http: ^1.5.16 => 1.5.16
next-with-apollo: ^4.3.0 => 4.3.0
react-apollo: ^3.1.3 => 3.1.3

@chemicalkosek
Copy link
Author

chemicalkosek commented Jan 14, 2020

Actually I have just observed that even if I turned off polling on other components (pages) and left only one this issue is still there. Meaning I go to a page which doesn't have polling (but has the given query) and polling continues and starts to fire more frequently.

Could be related? #3644

@chemicalkosek
Copy link
Author

Closing as the issue is related to when a GraphQL error exists then polling starts to increase and also continues when the component umounts (polling continues on pages where it doesn't even exist). After upgrading to Apollo CLient 3.0@beta everything works fine for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant