fix: restore warm on-demand query readiness #1860
Merged
KyleAMathews(GitHub profile, opens in a new tab)merged 15 commits into
main fromrefs/pull/1860/head·merged by KyleAMathews(GitHub profile, opens in a new tab) Showing 23 changed files with 31 additions and 1 deletion (loading 19).
x
@@ -0,0 +1,7 @@
+---
+'@tanstack/react-db': patch
+'@tanstack/db-sqlite-persistence-core': patch
+'@tanstack/electric-db-collection': patch
+---
+
+Retain retry-stable Suspense resources and preserve persisted demand readiness across lifecycle transitions. Avoid redundant Electric refreshes when requesting subset snapshots, and declare React 18 as the minimum supported React version.
23 additions and 0 deletions+23-0docs/contributing/oracle-reviews/2026-09-27-retained-demand-terminal.mdAddedView file
@@ -0,0 +1,23 @@
+# Retained-demand terminal failure oracle
+
+- Reviewed semantic commit: `3c6e9df082f6a5db0c351a6f58631d9d72104d80`
+- Comparison main: `f473a36201abe9af43d36a83492a2649668756d8`
+- Owner: `packages/db-sqlite-persistence-core/tests/persisted.test.ts`, property `persistence.retained-demand`
+- Runtime: local Node/Vitest 3.2.4; recording persistence adapter, not a browser or OPFS host
+
+| Requirement | Result |
+| --- | --- |
+| ORC-001 | Pass. RFC #1659 invariant 7 and the existing terminal-failure load contract require a later exact retained demand to reject with the same terminal error. A cached row is not evidence that durability recovered. The oracle does not claim real-host behavior. |
+| ORC-002 | Pass. The expected readiness comes from an independent set of retained demand names. After a failed source receipt, the expected result is its exact terminal error with no new upstream call; the model does not read production's hydrated-demand cache or terminal classifier. |
+| ORC-003 | Pass. The file header states the contract and limit; the demand operation arbitrary and fixed terminal suffix form the grammar; the set plus absorbing failure rule form the model; the real persisted wrapper is the driver; result identity and upstream-call count are checked after the failure. |
+| ORC-004 | Pass within this bounded grammar. The RED shrink reconstructed `[acquire one]`; acquire/release and inserted truncate positions retain the prior ownership/reset histories. Removing the terminal suffix lets the old fast-path defect survive. The range is 1–20 demand actions with at most four truncate insertions, two exact demand names, and one terminal source write. Unknown demand names are excluded; release without an active owner is a legal no-op. This does not generate concurrent host schedules. |
+| ORC-005 | Pass. The driver calls the wrapper's `loadSubset`, retains a hydrated demand, fails a source commit through `applyCommittedTx`, then calls `loadSubset` again. It observes the applied-receipt error, the next load result, and absence of a new upstream call at that checkpoint. |
+| ORC-006 | Pass. Before the production guard, the random property failed after one case and shrank to `[acquire one]`: the later load completed instead of rejecting, and the fast path called upstream. This was an assertion failure at the intended checkpoint, not a setup failure or timeout. |