Skip to content

What's the preferred way to deal with intermittent network issues? #8498

Answered by TkDodo
s992 asked this question in Q&A
Discussion options

You must be logged in to vote

We have a few users on fairly poor internet connections and as a result we see some requests failing with network errors

We mostly handle this with retries. I would maybe continue to do more retries when there are network errors, and you can also use the returned failureCount and failureReason to display information to the user if that is happening.

Is there a config option that will blow away cached data for a given query when a network error is encountered while fetching new data for that query?

no, but you can just catch errors in the queryFn, check if they are network errors, and return null in those cases. Then, null will be cached as a “successful request”. To re-enable automati…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@s992
Comment options

Answer selected by s992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants