Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/fix-adapter-page-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@tanstack/db': patch
'@tanstack/db-ivm': patch
'@tanstack/react-db': patch
'@tanstack/preact-db': patch
'@tanstack/vue-db': patch
'@tanstack/solid-db': patch
'@tanstack/angular-db': patch
'@tanstack/svelte-db': patch
---

Keep adapter-owned live queries and their source subscriptions when only the ordered query's finite `.limit()` or `.offset()` changes. Preserve exact requested bounds when moving page windows, and avoid React 18 layout-effect warnings during server rendering.
2 changes: 1 addition & 1 deletion docs/contributing/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ production queues, caches, or semantic helpers merely to share their names.
| source Collection | A Collection read by a query or adapter. | Source relation when the value is a public Collection. |
| live-query Collection | A Collection whose rows are produced by a live query. | Query, observer, or result set. |
| framework binding | What one mounted framework hook or injector keeps between updates: its compiled live query or window binding, its observer or controller, and its source Collection ID claims. | Subscription, observer, or live-query Collection. |
| query identity | The value that decides whether a framework binding compiles its query input again: a nonempty `queryKey`, or the identity derived from the query IR. A `DbClient` matches preloaded and hydrated queries by its hash. React and Preact compare it on every render; reactive adapters compile again when their reads change and compare none. | Query hash when the value is not hashed, or dependency list. |
| query identity | The value that invalidates a framework binding's authored query input: a nonempty `queryKey`, or the identity derived from the query IR. A `DbClient` matches preloaded and hydrated queries by its hash. React and Preact compare it on every render; reactive adapters resolve again when their reads change and compare none. An adapter-owned finite outer-window change can retain its compiled plan and Collection despite a changed result identity. | Query hash when the value is not hashed, or dependency list. |
| source Collection ID claim | A framework binding's record of which source Collection object each Collection ID named, per `DbClient` scope, kept while the binding is mounted. A binding that compares query identity rejects a different object under a claimed ID. | Collection registry or source identity. |
| window binding | The infinite-query state a framework binding keeps between updates: the input, its identity dependencies, the page shape, the window collection, and its controller. `bindLiveQueryWindow` decides whether to keep it, replace its controller, or bind a new window collection. | Window controller or live-query Collection. |
| pooled live query | A live query on one source Collection whose `where` has at least one `eq(field, literal)` conjunct and otherwise reads only the row, optionally ordered by the row's own fields without a limit, served from an equality partition; its live-query Collection is built only when read. | Cached query or shared live-query Collection. |
Expand Down
43 changes: 43 additions & 0 deletions docs/contributing/oracle-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,21 @@ is not browser evidence. `hydration.svelte.test.ts` separately receives
normalized transport and normal warm-browser initialization through its native
scheduler.

The [React SSR diagnostic receiver](../../packages/react-db/tests/ssr-effects-oracle.test.ts)
extends that preparation grammar and judgment with real matched React/ReactDOM
18.3.1 and 19.2.4 development server renderers. Separate paths cover provider
and explicit-client ordinary hooks, completed non-streaming Suspense through
both client forms, standalone builders and supplied Collections. A disabled
input replays the same diagnostic comparison. Each checks return and the raw
React client-layout diagnostic after server render and cleanup; ordinary
descriptor paths also compare admission, selected rows and status, while
prepared Suspense compares rows. Standalone/supplied paths make no hydration
claim. Fixed/fresh campaigns retain per-runtime/path reach and direct replay;
this does not establish streaming Suspense, actual browser hydration, arbitrary
provider delivery or every React version. Client commit and abandonment remain
with the window receiving owner. [SSR effect evidence](oracle-reviews/2026-10-30-react-ssr-effects.md)
records pre-edit RED, repaired GREEN and hostile rejection.

The shared admission owner also defines runtime ready/error outcomes, browser
explicit preparation and defined/undefined causes. Its receiving drivers are
`packages/react-db/tests/ssr-runtime-error-handoff-oracle.test.tsx` and
Expand Down Expand Up @@ -3649,6 +3664,21 @@ target execution, not reproduction of a particular bug. Local IVM and offline
properties have separate environment variables; inspect their test headers.
Do not assume the core multiplier reaches them.

The adapter-window properties have named replay routes in
`packages/db/tests/oracle-replay-manifest.ts`. Each shared history property
includes its production driver: `framework.<driver>.window-history`,
`framework.<driver>.pending-window-history`, or
`framework.<driver>.publication-window-history`. The drivers are `react`,
`react-dependency-list`, `preact`, `vue`, `solid`, `angular`, and `svelte`.
Each route selects its own conformance file and names the shared model module
as its source. React and Preact render witnesses, all twelve React SSR
runtime/path cells, and the IVM numeric-window lane retain their own routes.
Selectors choose only the fresh or random campaign. The earlier three shared
`framework.*` names are retired because they lost the failing driver's identity.
The [replay review](oracle-reviews/2026-10-30-adapter-page-window-replay.md)
records the 21 driver/history witnesses and correction of the earlier canonical
React routing claim in the preparation record.

The Node expression-index oracle runs matching fixed-seed and seedless-random
campaigns by default. A path replay of its property selects only the
requested seed and shrink path:
Expand Down Expand Up @@ -6273,3 +6303,16 @@ useful extension: the hash identity oracle owns those semantic distinctions,
but its helper-level evidence does not by itself exercise distinct storage.
The separate Index structural-collision obligation above remains open.
See the appended [review evidence](oracle-reviews/2026-10-30-distinct-collisions.md).


### Adapter-owned page windows

The framework owner includes [window-history-oracle.ts](../../packages/db/tests/conformance/window-history-oracle.ts), registered through the shared conformance suite in React, Preact, Vue, Solid, Angular and Svelte. Maintainer decision 2026-10-30 for #2291: changing only `.limit()`/`.offset()` moves the existing outer window; it adds no hook option. The independent sort/filter/slice model checks ordered selected rows and keyed-map values after each framework flush, Collection retention for page moves, replacement for source/filter/order/projection/nested-window changes, and retained upstream ownership. Direct and nested paths have separate reach, as do changing/stable/opaque keys where the driver supports keys. Keyed source swaps include distinct source objects under one Collection ID. Generated source updates check liveness after reuse. The bare-callback lanes also vary a Collection option together with a page change and check its applied value. The pending lane observes a move during initial loading, oldest settlement while the latest remains pending, initial readiness, overlapping held acquisitions, final latest rows, and unmount before settlement. The publication-callback lane changes offset, limit or both from a public change callback, then checks the retained Collection after the host settles. It controls demand settlement over already installed source rows; the core pagination owner continues to own source delivery, failures and ordered repair.

The [React receiving witness](../../packages/react-db/tests/window-render-oracle.test.tsx) reuses this model/checker at suspended, cancelled and committed render cuts for eager and finite on-demand sources, with derived and explicit keys. It checks the captured committed Collection and provider acquisition count while a render is abandoned. The [Preact receiving witness](../../packages/preact-db/tests/window-render-oracle.test.tsx) checks an aborted render under a real error boundary while a public subscription keeps the committed Collection active. Both run separate offset-only, limit-only and combined-move campaigns with declared reach per category. These do not establish arbitrary concurrent framework schedules. The retained-work observation checks continuous upstream ownership and every public subscription-count transition during a retained move; add-before-remove replacement fails, while retired Collections may complete GC. This is not a bound on CPU time or every possible internal compilation strategy. DbClient/hydration and Suspense shared-result caches, supplied Collections, opaque-plan optimization, queries without an outer limit and findOne retain their existing contracts and paths; this fix does not retarget their shared Collections. The generated retention guarantee covers finite bounds. An explicit Infinity limit can also move to a finite target under the resolver guard, but this evidence does not establish that additional domain or promise replacement outside the finite domain. The existing identity, deferred-acquisition, window-controller and includes owners remain authoritative for their neighboring laws.

Evidence, per-path reach counts, reviewer reconciliation and mutation outcomes are recorded in [the page-window review](oracle-reviews/2026-10-30-adapter-page-windows.md).

The [fresh independent review](oracle-reviews/2026-10-30-adapter-page-windows-round-2.md) records observation and failure-fidelity repairs. Shared and receiving campaigns preserve the first violated law, checkpoint and input trace through shrinking. Later action and cleanup failures remain distinguishable; non-reproducing shrink candidates supply no successful product evidence. The original late-coverage process gap remains documented.

The existing [top-K support-window owner](../../packages/db-ivm/tests/operators/topk-support-window-oracle.test.ts) also has a numeric-window lane for safe-integer maximum offsets and widths, exact omitted-bound inheritance on partial moves, and required demand messages when installed ranges are empty. It permits additional messages. It observes one-group settled operator rows, size and demand signals; real framework source growth belongs to the shared receiving owner above. [Numeric evidence](oracle-reviews/2026-10-30-topk-numeric-windows.md) records RED, GREEN, reach, replay and mutants.
Loading
Loading