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

useQuery: skip does not stop polling. #11120

Open
phryneas opened this issue Aug 2, 2023 · 2 comments
Open

useQuery: skip does not stop polling. #11120

phryneas opened this issue Aug 2, 2023 · 2 comments

Comments

@phryneas
Copy link
Member

phryneas commented Aug 2, 2023

@phryneas I could narrow it a little bit down:

  • It seems that in my case the problem appears when combined with polling. In my case the 1st call should not skip but later ones should. It looks like the polling ignores the skip property.
  • It seems that this was introduced in 3.7.11. Below is a small repro. The logs and the network requests show that the requests are fired even though skip is true. When switching to 3.7.10, the requests are not fired.

https://codesandbox.io/s/skip-does-not-work-forked-sdr7d2?file=/src/App.js

Originally posted by @tobiaswaltl in #6190 (comment)

Additionally, setting pollInterval to undefined doesn't seem to help:

As a workaround I tried to set the pollInterval to undefined when the condition for skip evaluates to true. But, like skip, this is ignored and the polling is continued. I.e. it seems it's nothing skip-specific causing this bug.

@phryneas
Copy link
Member Author

Probably related: #9431

@andreimatei
Copy link

I have also run into both problems mentioned here:

  1. changing the value of skip does not have the intended effect
  2. changing the value of pollInterval to undefined does not have the intended effect (*)

Should we leave the two problems bundled together in this issue, or create a new one for the second?

(*) however, changing the value of pollInterval to a really large number does work

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

No branches or pull requests

3 participants