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
When using useInfiniteQuery for the chats inside the React Native Expo project, the data returned by the queryFn is new and correct, but the previous stale data inside the cache is not updated.
Examples of the data I'm logging:
Data Received by queryFn (Server Response): (This is what the server sent, which includes the newest item, "Test message 11", and total: 10.) LOG data {"items": [{"content": "Test message 11", "createdAt": "...", "id": "14df25d9...", ...}, {"content": "Test message 10", ...}], "total": 10}
Data Stored in Cache 5 seconds Later (Corrupted State): (This is what queryClient.getQueryData() shows—it's missing "Test message 11" and the total is wrong.) LOG cacheData: {"items": [{"content": "Test message 10", ...}, {"content": "Test message 9", ...}], "total": 9}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When using
useInfiniteQueryfor the chats inside the React Native Expo project, the data returned by thequeryFnis new and correct, but the previous stale data inside the cache is not updated.Examples of the data I'm logging:
Data Received by queryFn (Server Response): (This is what the server sent, which includes the newest item, "Test message 11", and total: 10.)
LOG data {"items": [{"content": "Test message 11", "createdAt": "...", "id": "14df25d9...", ...}, {"content": "Test message 10", ...}], "total": 10}Data Stored in Cache 5 seconds Later (Corrupted State): (This is what queryClient.getQueryData() shows—it's missing "Test message 11" and the total is wrong.)
LOG cacheData: {"items": [{"content": "Test message 10", ...}, {"content": "Test message 9", ...}], "total": 9}The issue occurs despite this configuration:
Beta Was this translation helpful? Give feedback.
All reactions