Skip to content

useFirestoreDocument/useFirestoreQuery with { subscribe: true } are not subscribing to realtime updates on remount #25

@ifours

Description

@ifours

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreact-query-firebaseIssue is specific to React Query Firebase branch

Type

No type

Projects

Status

Opened

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions