Skip to content
Source
Sign inSign up
TanStack/db

fix(db): stop old notification holds from affecting restarted sync #1921

MergedKyleAMathewsmerged 11 commits intomain fromrefs/pull/1921/headmerged by KyleAMathews

Showing 7 changed files with 166 additions and 0 deletions (loading 4).

x
0 of 7 viewed, 7 left
5 additions and 0 deletions.changeset/fix-deferral-cleanup-publication.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/db': patch
+---
+​
+Keep publications from a restarted Collection independent of deferrals that cleanup retired. Subscribers now receive the new sync run's changes even when an old deferral handle closes later.
153 additions and 0 deletionsdocs/contributing/oracle-reviews/2026-09-28-deferral-cleanup.mdAdded
View file
@@ -0,0 +1,153 @@
+# Publication deferral cleanup review
+​
+## Reviewed state and law
+​
+- Base commit: `33a194941c8d51f8f98babb999fef2987dd6ff8b`.
+- Reviewed implementation and oracle head:
+ `8a6a024e` (the review record follows that immutable commit).
+- Owner: `packages/db/tests/collection-subscription-lifecycle-publication.property.test.ts`
+ with its deferral histories in `collection-subscription-lifecycle-grammar.ts`.
+​
+Collection cleanup ends a sync run. A publication deferral from that run cannot
+discard or publish a later run's subscriber batch. The new run publishes its
+committed changes when its own deferral closes with `publish()`. Its own
+`discard()` suppresses those changes. The driver compares the exact subscriber
+batch after each handle closes and checks for early delivery after an old
+handle closes.
+​