You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
retry doesn't stop during the internet is disconnected #2900
After use the offline mode by DevTools > Network > Throttling, this component doesn't show the loading or even never stop fetching. It's expected to stop fetching and shows the error after once trying...
But after setting this config: retry: false code works correct and shows the error and retrying button.
changed the title [-]retry doesn't stop during the internet has disconnected[/-][+]retry doesn't stop during the internet is disconnected[/+]on Nov 8, 2021
retries are an internal mechanism, and currently, react-query stops retrying if you are offline. You can observe the failureCount returned by useQuery to see if a failure has been detected.
I'm seeing it more of an issue that calling refetch shouldn't even start fetching if you are currently offline. Right now, it starts the fetch, but then retries "pause" when offline. What it should most likely do is mark the query as stale so that it will be refetched once the user comes back online.
But any change in this regard would be a breaking change, so we'll have to discuss this for the next major version.
Activity
[-]retry doesn't stop during the internet has disconnected[/-][+]retry doesn't stop during the internet is disconnected[/+]TkDodo commentedon Nov 8, 2021
retries are an internal mechanism, and currently, react-query stops retrying if you are offline. You can observe the
failureCountreturned byuseQueryto see if a failure has been detected.I'm seeing it more of an issue that calling
refetchshouldn't even start fetching if you are currently offline. Right now, it starts the fetch, but then retries "pause" when offline. What it should most likely do is mark the query asstaleso that it will be refetched once the user comes back online.But any change in this regard would be a breaking change, so we'll have to discuss this for the next major version.
related:
TkDodo commentedon Nov 11, 2021
we will be tracking this issue and related ones here from now on:
The plan is to work on this for the next major version, because it will contain breaking changes. Your feedback would be appreciated.