-
Notifications
You must be signed in to change notification settings - Fork 1.3k
RefreshInterval Config Not Respected After Errors #830
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
Comments
In my example sandbox application you can see that the request count rises to 4, hits the 5xx error on request 5, then will succeed to pull another single request but stops thereafter. |
I might also note why I care about this scenario (continual refresh regardless of errors, interaction, etc) specifically is because this is a site loaded on a remote display that isn't interacted with. |
how do you solve it? |
For other people having the issue: use |
I have set up the useSWR hook in a Next.js application that is intended to continually refresh some API data. I was noticing that after some errors (502s technically, but any error is fine to reproduce) the
refreshInterval: 2000
I had set wasn't being used anymore and only manually re-focusing the page would cause a revalidation/refresh of the data. Even then, therefreshInterval
didn't not pick back up after the error went away.I have also tried manually specifying an
onErrorRetry
method which did not change the outcome:Any guidance here would be much appreciated.
Expected Behavior
I was expecting the
refreshInterval
to be respected after the error retry logic was able to get a positive result again.Repro Steps / Code Example
https://codesandbox.io/s/gifted-gagarin-od5ut
Additional Context
SWR version 0.3.9
The text was updated successfully, but these errors were encountered: