react-query-native-devtools icon indicating copy to clipboard operation
react-query-native-devtools copied to clipboard

Query status is always fresh

Open apatel369 opened this issue 3 years ago • 9 comments

I haven't changed the default stale time so the query should become immediately stale. But it keeps showing as fresh.

Updated Time Status Query Hash 23:16:29.720 fresh ["Events","Chetanbhai"] 23:21:30.428 fresh ["Teams","Chetanbhai"]

How to fix this?

apatel369 avatar Jan 16 '22 05:01 apatel369

@apatel369 could you try v4.0.0 and see if you are still seeing it?

bgaleotti avatar Jan 23 '22 15:01 bgaleotti

4.0.0 do not display anything at all. No queries. Just search bar and column titles for results.

apatel369 avatar Jan 26 '22 06:01 apatel369

After restarting I can see the query but it is showing fresh as before.

apatel369 avatar Jan 26 '22 06:01 apatel369

After restarting the flipper again I can see the new GUI and my queries. But status is a 'success'. What does it mean? React query has four statuses fresh, fetching, stale and inactive I know of.

apatel369 avatar Jan 26 '22 06:01 apatel369

In v4, as in https://codesandbox.io/s/github/tannerlinsley/react-query/tree/master/examples/simple, we are showing state from query.state.status.

In v3 status used to be what you are expecting @apatel369.

Maybe it is worth reintroducing v3 behaviour. @dmitrybirin Any thoughts?

bgaleotti avatar Jan 26 '22 11:01 bgaleotti

@bgaleotti How can I know in v4 whether it is stale, fresh or isfetching?

apatel369 avatar Jan 27 '22 01:01 apatel369

@apatel369 can you try v4.1.0 from Flipper plugin?

bgaleotti avatar Feb 07 '22 21:02 bgaleotti

@bgaleotti thanks for pushing changes but I still see it keep showing fresh even though it is stale. Also when I kill the app it keeps showing as fresh. When it re-fetch I see one of them change status to fetching and another one keeps fresh as status. But data updated count increases for both cause actually, both are stale and hence both re-fetch in the background.

apatel369 avatar Feb 08 '22 00:02 apatel369

Also, react query 4 is coming up with new modes and statuses. https://tkdodo.eu/blog/offline-react-query. So I think it is now more important to show statuses correctly

apatel369 avatar Feb 13 '22 04:02 apatel369