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
If one of my queries fails at one point (e.g. because the backend server is unreachable for a while), the following line sets query.shouldContinueRetryOnFocus to true:
If this flag is true, the query gets refetched every time the window is focused.
However, you seem to have forgotten to delete this flag once the query succeeds again. This causes the query to be refetched on every window focus event, even if it's perfectly fresh and not stale.
The text was updated successfully, but these errors were encountered:
I‘m sorry, I don‘t feel like I know enough about the intricacies of how your code and testing works to actually fix this in your code. I just worked around this bug in my code for the time being by getting an instance of the query object from the cache and deleting the flag myself upon a successful fetch. I‘m sure this is way easier to fix for you than it would be for me.
If one of my queries fails at one point (e.g. because the backend server is unreachable for a while), the following line sets query.shouldContinueRetryOnFocus to true:
https://github.com/tannerlinsley/react-query/blob/66f462c2f9552ca2bbda8ac0fd7595bdb1a4008e/src/queryCache.js#L400
If this flag is true, the query gets refetched every time the window is focused.
However, you seem to have forgotten to delete this flag once the query succeeds again. This causes the query to be refetched on every window focus event, even if it's perfectly fresh and not stale.
The text was updated successfully, but these errors were encountered: