Skip to content
Source
Sign inSign up
TanStack/db

Query Collection "Incremental Updates" example never updates with server-sent data. #814

Send to my agent
Closedwillhoney7(GitHub profile, opens in a new tab) opened this issue 1 comment
  • I've validated the bug against the latest version of DB packages

Describe the bug Query Collection Example Incremental Updates does not ever update the collection with the new server data. The idea is that the server data is supposed to load in to the collection once the insert is complete but in practice the collection only retains the old, client-only data.

To Reproduce I've created a codesandbox that illustrates the issue clearly. You can see that the "id" never switches from the client-side negative number to the server-side positive number.

https://codesandbox.io/p/sandbox/tanstack-db-bug-7txp3s?file=%2Fsrc%2FApp.tsx

Expected behavior I would expect the collection data to correctly update with the server-sent data. (Or, does the documentation need to be changed with this no longer being the correct way to achieve this functionality?)

Thanks!

  1. Hey @willhoney7 thanks for the report.

    This is fixed by pr #879 and I've forked your reproduction to use the preview package from that PR: https://codesandbox.io/p/sandbox/tanstack-db-bug-forked-nqtkvp?file=%2Fsrc%2FApp.tsx

    All working well now!

Sign in to join this conversation.