-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Discussed in #2676
Originally posted by jdupont22 September 16, 2021
Hi,
I've a strange situation, i don't know if it's normal!
I try to load some "offers" with useQuery(["offers, deepJson])
.
I have a "staleTime=20s" and the default "cacheTime=5m".
useQuery(["offers",{"order":"desc","page":1,"q":null,"size":10,"sort":"name","states":["ACTIVE"]}])
I've the following result, react-query retry 3 times and failed! It's ok.
Now, I click on the tab "Inactive", that change the deepJson states to "states":["INACTIVE"]
I see in the react-query devtool the params change, but the request is not trigger!!!
There is a "disabled" query with this keys, but i would imagine that a query in error will retry the next time? it's based on the cache expiration?
Can you explain to me this current behavior? When the query return 200 OK, switching tab work perfectly!
Thx
thanks for reporting. This seems to have worked correctly up until v3.19.4. I'll create an issue out of this.
Here is a slight variation of your codesandbox without window focus refetching, without retries, with a 1 second fetch delay and with devtools, so that we can better see when fetching transitions are happening: https://codesandbox.io/s/interesting-elbakyan-zz28f?file=/src/App.js