Skip to content
Source
Sign inSign up
TanStack/db

test(db): cover source deletes for keys the source never held #2008

MergedKyleAMathewsmerged 6 commits intomain fromrefs/pull/2008/headmerged by KyleAMathews

Showing 5 changed files with 120 additions and 2 deletions (loading 2).

x
0 of 5 viewed, 5 left
118 additions and 0 deletionsdocs/contributing/oracle-reviews/2026-10-02-absent-key-source-delete.mdAdded
View file
@@ -0,0 +1,118 @@
+# Source delete for a key the source never held
+​
+Base revision: `06cab6fc7` (`main` after #2005). Tested revision:
+`74e5b80d6`. Production code is unchanged from the base revision.
+​
+## Contract
+​
+A source may delete a key it does not hold. A typical cause: the backend
+accepted an optimistic insert, then deleted the row before the source
+streamed it. The maintainer decision for this owner is:
+​
+- An accepted optimistic snapshot of the key retires, as it does for any
+ ordinary source publication. The row disappears.
+- An active request for the key stays in place. The delete removes no base
+ row and acknowledges no request.
+​
+`main` already behaves this way. This review adds the generated histories
+and witnesses. It changes no production code.
+​
+## Gap
+​
+The coverage map listed the case as open. The optimistic-history driver
+dropped every delete for a key the source did not hold before the model or
+the Collection saw it. So no optimistic-history campaign ever wrote such a
+delete.
+​
+## Witnesses
+​
+- The driver keeps deletes for keys the source does not hold and counts them.
+ The fixed campaign must write at least one, beside deletes of held keys.