bgaleotti / react-query-native-devtools

161 stars 19 forks source link

Query status is always fresh #78

Open apatel369 opened 2 years ago

apatel369 commented 2 years ago

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?

bgaleotti commented 2 years ago

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

apatel369 commented 2 years ago

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

apatel369 commented 2 years ago

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

apatel369 commented 2 years ago

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.

bgaleotti commented 2 years ago

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?

apatel369 commented 2 years ago

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

bgaleotti commented 2 years ago

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

apatel369 commented 2 years ago

@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 commented 2 years ago

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