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
{{ message }}
Repository navigation
Optimistic entities not cleared after insert #1464
Perform an action to add location (the entity I am working with)
onInsert runs
optimistic + new synced entity remain in the collection (or at least the return value from the useLiveQuery)
Expected behavior
"The optimistic state is held until the handler resolves, at which point the data is persisted to the server and synced back" I expect the server data to be synced back, replacing the optimistic data, not appended adjacent to it
Desktop (please complete the following information):
Device: Apple m3 pro
OS: Tahoe 26.3.1
Browser: Brave
Version:
Brave 1.87.191
Chromium: 145.0.7632.120
Smartphone (please complete the following information):
n/a
Additional context
This is my getKey function (if relevant) getKey: (location) => location.id,
If I change getKey to a value that is stable between local and remove versions (like location.name) then I don't see this issue, but based off the following, I should be able to safely set this to an id / should only be relevant for update/delete operations
* Function to extract the ID from an object
* This is required for update/delete operations which now only accept IDs
* @param item The item to extract the ID from
* @returns The ID string for the item
* @example
* // For a collection with a 'uuid' field as the primary key
* getKey: (item) => item.uuid
*/
@samwillis sorry to be a bother, but this is a pretty bad regression. Can we get this looked into today? Seems like there are quite a few people seeing this.
Activity
willbowdler-cc commentedon Apr 8, 2026
I presume it is related to this issue: #1442
willbowdler-cc commentedon Apr 8, 2026
If I change
getKeyto a value that is stable between local and remove versions (likelocation.name) then I don't see this issue, but based off the following, I should be able to safely set this to anid/ should only be relevant forupdate/deleteoperationsandorep commentedon Apr 14, 2026
I have the same issue 🙁
willbowdler-cc commentedon Apr 14, 2026
@samwillis sorry to be a bother, but this is a pretty bad regression. Can we get this looked into today? Seems like there are quite a few people seeing this.
n0119566 commentedon May 2, 2026
Same issue over here
am1006 commentedon May 24, 2026
I think it might have the same root cause as #1442 - which is now fixed by #1547, released in
@tanstack/db@0.6.7on 2026-05-23.KyleAMathews commentedon May 24, 2026
Ah thanks @am1006