invertase / invertase/tanstack-query-firebase
useFirestoreDocument/useFirestoreQuery with { subscribe: true } are not subscribing to realtime updates on remount
Open
bug
react-query-firebase
- Dominant language
- TypeScript
- Stars
- 462
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
I've discovered a weird behaviour of useFirestoreDocument/useFirestoreQuery hooks: `{ subscribe: true }` option will have no effect, if query is remounted (in default `cacheTime` 5 mins window), after became inactive. Probably, It will be good, if query will resubscribe to realtime changes, if there is a snapshot in a cache and there are no active subscribers.
As a workaround we are setting `cacheTime` to 0, so query will trigger queryFn again and put active subscription on firestore query.
Contributor guide
Assessment
This issue has not been assessed yet.