You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After bumping @react-query-firebase/firestore (mostly to workaround React 18.2.0 peer dep), the query invalidation stops working.
I do not have time to create minimal repro sandbox. Posting as a heads-up to others.
Reverting to 0.4.2 fixes the issue.
Simplified pseudo-code:
// Disable auto-refetching to avoid noise.
const queryClient = new QueryClient({defaultOptions: {queries: {staleTime: Infinity, cacheTime: Infinity}}});
<QueryClientProvider client={queryClient}>...</...>
const ref = docRef.withConverter(converter);
// simplified, just to demonstrate invalidation method.
const onSuccess = async () => ({await queryClient.invalidateQueries({predicate: () => true})});
const {data} = useFirestoreDocumentData(path, ref), // not a subscription
{mutate} = useFirestoreDocumentMutation(docRef, {merge: true}, {onSuccess});
Actual results when calling mutate({field: someVal})
The value is updated is Firebase
onSuccess is called
The query is invalidated as expected and refetched, according to network/logs/react-query-devtools
According to debug logs, after refetching the converter applied on ref is called with proper "new" value
Until this point, works as expected. But the values are not updated in:
query data in react-query-devtools,
useFirestoreDocumentData hook data in React Dev Tools,
the app.
The text was updated successfully, but these errors were encountered:
After bumping
@react-query-firebase/firestore
(mostly to workaround React 18.2.0 peer dep), the query invalidation stops working.I do not have time to create minimal repro sandbox. Posting as a heads-up to others.
Reverting to 0.4.2 fixes the issue.
Simplified pseudo-code:
Actual results when calling
mutate({field: someVal})
onSuccess
is calledref
is called with proper "new" valueUntil this point, works as expected. But the values are not updated in:
useFirestoreDocumentData
hook data in React Dev Tools,The text was updated successfully, but these errors were encountered: