Skip to content
Source
Sign inSign up
TanStack/db

fix(db): harden optimistic settlement and queued derived updates #1807

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/1807/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 14 changed files with 28 additions and 6 deletions (loading 11).

x
0 of 14 viewed, 14 left
5 additions and 0 deletions.changeset/fix-optimistic-field-reconciliation.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/db': patch
+---
+​
+Preserve whole-row optimistic snapshots through sync and truncate. Fix insert-dependent update settlement, local origin tracking, and rollback publication while sibling requests remain pending. Keep source updates beneath an optimistic live-query delete when queued sync batches apply, without changing sync queue timing.
16 additions and 1 deletionAGENTS.mdModified
View file
@@ -362,7 +362,8 @@
​
### Always Add Tests for Bugs
​
-**Key Principle:** If you're fixing a bug, add a unit test that reproduces the bug before fixing it. This ensures:
+**Key Principle:** Reproduce a bug in a test before fixing it. Prefer extending
+an oracle as described below over adding an isolated unit test. This ensures:
​
- The bug is actually fixed
- The bug doesn't regress in the future
@@ -389,6 +390,20 @@
the smallest test or oracle improvement that would catch the same class of bug,
not only the reported example.
​
+### Prefer Oracle Coverage Over Isolated Regressions