Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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