-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
onErrorRetry not triggered after tab blur+focus with useSWRImmutable #2543
Comments
This also happens using |
I encountered this. I tried to debug it. When it comes to softrevalidate on focus and reconnecting. we check these conditions on focus - But, in the case of swrimmutable we don't want to revalidate the data but what if API fails and we have to run errorOnRetry. then we have to revalidate and there comes executing softRevalidate. I think we should also add a condition checking |
Bug report
Description / Observed Behavior
useSWRImmutable
stops retrying errored requests if you switch to a different browser tab then go back to the application.This happens using the default
onErrorRetry
as well as a custom one.Expected Behavior
Like
useSWR
,useSWRImmutable
should keep retrying until the request ends successfully.Of course, once the first successful request is finished
useSWRImmutable
should never run again, unlikeuseSWR
.Repro Steps / Code Example
https://codesandbox.io/s/useswrimmutable-onerrorretry-bug-89n0de
Additional Context
SWR version 2.1.2
The text was updated successfully, but these errors were encountered: