test(db): add controlled includes oracle drivers #1720
main fromrefs/pull/1720/head·merged by tannerlinsley This adds deterministic state and temporal oracle coverage for nested includes. It does not change production behavior; instead, it records known failures precisely so later fixes can proceed in small, independently verified PRs.
Approach#
- Expand the full-row state matrix with guaranteed visible branches at depths 1–4:
- multi-row batches at every depth
- visible reparenting at every depth
- visible rekeying at depths 2–4
- Keep passing cases green while recording newly exposed depth-3 and depth-4 rekey failures as deterministic red seeds.
- Add controlled temporal drivers for:
- #1510: an empty outer query must become ready without loading an undemanded on-demand child; a non-empty outer remains the green control
- #1533: a nested progressive child must request its correlated subset inside the same early window as a direct filtered query
- demand-relative readiness: deleting the only parent must stop an obsolete pending child load from blocking readiness
- Give each trace checkpoint a stable index and require expected failures to match both that checkpoint and a real assertion mismatch. Runtime, observation, and cleanup failures remain visible.
Key invariants#
- Generated state transitions must change the independently recomputed result immediately before the tested transition.
- Every selected depth has a connected, observable branch; unrelated generated noise cannot erase it.
- Empty outer results cause zero child
loadSubsetcalls. - Progressive timing tests use explicit gates rather than elapsed time.
- A fixed bug makes its expected-failure test fail, while a failure at another checkpoint or from another error class does not satisfy the guard.
- Cleanup resolves controlled promises and preserves the primary trace failure if cleanup also fails.
Non-goals#
- This PR does not fix any of the production bugs it exposes.
- It does not add the Electric end-to-end progressive-sync case; these drivers cover the query-layer contract with controlled collections.
- It does not broaden the oracle to publication/revision or ownership behavior.
Trade-offs#
The tests use small deterministic run counts and fixed seeds. This keeps CI stable and failures reproducible while retaining generated histories around guaranteed visible transitions.
Verification#
pnpm exec vitest run \
packages/db/tests/expected-failure.test.ts \
packages/db/tests/trace-runner.test.ts \
packages/db/tests/query/includes-temporal-oracle.test.ts \
packages/db/tests/query/includes-oracle.property.test.ts \
--maxWorkers=2
pnpm exec tsc --noEmit -p packages/db/tsconfig.json
pnpm exec eslint \
packages/db/tests/query/includes-temporal-oracle.test.ts \
packages/db/tests/query/includes-oracle.property.test.ts \
packages/db/tests/trace-runner.ts \
packages/db/tests/trace-runner.test.ts \
packages/db/tests/expected-failure.ts \
packages/db/tests/expected-failure.test.ts
pnpm exec prettier --check \
packages/db/tests/query/includes-temporal-oracle.test.ts \
packages/db/tests/query/includes-oracle.property.test.ts \
packages/db/tests/trace-runner.ts \
packages/db/tests/trace-runner.test.ts \
packages/db/tests/expected-failure.ts \
packages/db/tests/expected-failure.test.ts
git diff --check origin/main
Focused result: 45 tests passed.
Files changed#
packages/db/tests/query/includes-oracle.property.test.ts— expands the visible relationship matrix and pins all known state failures to exact checkpoints.packages/db/tests/query/includes-temporal-oracle.test.ts— adds readiness, progressive fast-path, and obsolete-demand drivers.packages/db/tests/trace-runner.ts— labels assertion failures with their trace checkpoint while preserving non-assertion errors.packages/db/tests/trace-runner.test.ts— covers checkpoint labeling, cleanup suppression, and error boundaries.packages/db/tests/expected-failure.ts— centralizes assertion-specific expected-failure guards.packages/db/tests/expected-failure.test.ts— proves those guards reject wrong checkpoints and runtime failures.
Refs #1658 Refs #1510 Refs #1533
Summary by CodeRabbit#
New Features
- Added clearer reporting for assertion failures, including the checkpoint where a failure occurred and its original cause.
- Added support for validating expected assertion failures by checkpoint or message.
Tests
- Expanded coverage for live query includes, temporal loading, deferred requests, cancellations, reparenting, and duplicate aliases.
- Improved verification of runtime, observation, cleanup, and assertion error handling.
- 1
Actionable comments posted: 1
🧹 Nitpick comments (8)
packages/db/tests/query/includes-temporal-oracle.test.ts (4)
171-171: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueName the live-collection type once.
ReturnType<typeof createLiveQueryCollection>instantiates the generic with its constraint, so the resulting row type is maximally loose andlive.get(...)results carry no useful shape. The expression also repeats in three context types. Introduce one alias, and consider parameterizing it with the projected row type where the test reads rows.♻️ Proposed refactor
+type LiveCollection = ReturnType<typeof createLiveQueryCollection>Then use
live: LiveCollectioninReadinessContext,DemandCancellationContext, andProgressiveContext.As per coding guidelines: "Always provide the most precise return type annotation".
Also applies to: 268-268, 419-419
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-temporal-oracle.test.ts` at line 171, Define a single LiveCollection type alias for the live-query collection, parameterized with the projected row type used by the test so live.get(...) retains a useful shape. Replace the repeated ReturnType<typeof createLiveQueryCollection> annotations in ReadinessContext, DemandCancellationContext, and ProgressiveContext with LiveCollection.Source: Coding guidelines
216-220: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueAn unfulfilled load turns a trace failure into a suite timeout.
startawaitscontext.parentLoaded.promise, andcreateColdPostsresolves that deferred only insideloadSubset. If the outer query never demands the parent subset, this trace hangs until the Vitest timeout instead of failing at a checkpoint. The same shape applies tocontext.childLoadStarted.promiseincreateDemandCancellationDriverandcontext.startReached.promiseincreateProgressiveDriver.Consider racing these waits against a bounded timer so a regression reports a diagnosable failure.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-temporal-oracle.test.ts` around lines 216 - 220, Update the async drivers around start, createDemandCancellationDriver, and createProgressiveDriver so waits on context.parentLoaded.promise, context.childLoadStarted.promise, and context.startReached.promise race against bounded timers. Reject or otherwise fail with a diagnostic checkpoint error when the timer expires, while preserving successful deferred-resolution behavior.
285-306: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDocument the late-bound
removeclosure.removeis reassigned insidesyncand exposed through the wrapper() => remove(). The wrapper is required so that callers observe the reassignment. Add a short comment, because a later refactor can replace the wrapper withremoveand silently capture the throwing placeholder.As per coding guidelines: "Keep comments that explain non-obvious behavior, such as return value signals or closure captures".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-temporal-oracle.test.ts` around lines 285 - 306, In the helper that creates the temporal removable post collection, add a short comment documenting that the returned wrapper around remove must remain late-bound so callers observe the reassignment performed inside sync rather than capturing the initial throwing placeholder. Keep the existing remove initialization and reassignment behavior unchanged.Source: Coding guidelines
230-246: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the repeated projection tail.
The three projections repeat the same
recomputeandassertEqualimplementations. Extract one helper and reuse it, so the comparison rule stays in one place.♻️ Proposed refactor
+function expectedProjection<TObserved>( + observe: (context: { expected: TObserved }) => TObserved, +): TraceProjection<{ expected: TObserved }, TObserved> { + return { + observe, + recompute: ({ expected }) => expected, + assertEqual: (observed, expected) => { + expect(observed).toEqual(expected) + return undefined + }, + } +}Then each projection only supplies
observe:-const readinessProjection: TraceProjection< - ReadinessContext, - ReadinessObservation -> = { - observe: ({ live, loads, preload }) => ({ ... }), - recompute: ({ expected }) => expected, - assertEqual: (observed, expected) => { - expect(observed).toEqual(expected) - return undefined - }, -} +const readinessProjection = expectedProjection<ReadinessObservation>( + ({ live, loads, preload }) => ({ ... }), +)As per coding guidelines: "Extract common logic into utility functions when identical or near-identical code blocks appear in multiple places".
Also applies to: 378-393, 608-622
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-temporal-oracle.test.ts` around lines 230 - 246, Extract the shared recompute and assertEqual behavior from the three projections into a single helper, then spread or otherwise reuse that helper in readinessProjection and the projections near the other referenced sections. Keep each projection responsible only for its observe implementation while preserving the existing comparison semantics.Source: Coding guidelines
packages/db/tests/expected-failure.test.ts (1)
22-44: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMake the negative assertions specific.
rejects.toBeInstanceOf(Error)passes for any thrown error, including an unrelated failure insideexpectAssertionFailureitself. Assert on the failure content so the negative cases keep their meaning.♻️ Proposed refinement
- await expect(guarded()).rejects.toBeInstanceOf(Error) + await expect(guarded()).rejects.toMatchObject({ + name: `AssertionError`, + })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/expected-failure.test.ts` around lines 22 - 44, Update both tests around expectAssertionFailure to assert the specific rejection content rather than only Error type: verify “startup mismatch” for the wrong-checkpoint case and “projection failed” for the runtime-error case, while preserving their existing rejection expectations.packages/db/tests/query/includes-oracle.property.test.ts (3)
1657-1675: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the redundant standalone coverage test.
This test samples
visibleRelationshipScenarioArbitrary(depth, 'reparent')with seed1721 + depth. The property test at Lines 1717-1744 uses the same arbitrary and the same seed, and it already assertsexpect(result).not.toEqual(beforeTransition)for every generated scenario. The standalone test adds runtime without adding a distinct assertion.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-oracle.property.test.ts` around lines 1657 - 1675, Remove the standalone `covers a visible relationship transition at every depth` test, including its scenario sampling and loop; the existing property test using `visibleRelationshipScenarioArbitrary` already covers the same seeded scenarios and assertion.
117-141: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExtract the shared action-type list.
The two
fc.constantFrombranches repeat three of four action types. Extract the child list and derive the root list from it, so a new action type only needs one edit.♻️ Proposed refactor
function actionArbitrary(depth: IncludeDepth): fc.Arbitrary<HistoryAction> { + const childTypes = [ + `put`, + `delete`, + `optimisticConfirm`, + `optimisticRollback`, + ] as const + const rootTypes = childTypes.filter((type) => type !== `delete`) return levelArbitrary(depth).chain((level) => fc.record({ // Root delete/reinsert has a deterministic expected-failure trace below. // Keep the green fuzz corpus from rediscovering the same defect class. - type: - level === 0 - ? fc.constantFrom( - `put` as const, - `optimisticConfirm` as const, - `optimisticRollback` as const, - ) - : fc.constantFrom( - `put` as const, - `delete` as const, - `optimisticConfirm` as const, - `optimisticRollback` as const, - ), + type: fc.constantFrom(...(level === 0 ? rootTypes : childTypes)), level: fc.constant(level),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-oracle.property.test.ts` around lines 117 - 141, Refactor the action-type definitions in the level arbitrary builder around the two fc.constantFrom branches: define the shared child action list once, then derive the root list by excluding delete, preserving the existing root and child behavior while allowing new shared actions to be added in one place.
2119-2119: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMatch test-owned data in the expected-failure guard.
/deeply equal/is Vitest boilerplate, so anytoEqualmismatch can satisfy this guard. Match data specific to the duplicate-alias failure instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/query/includes-oracle.property.test.ts` at line 2119, Update the expected-failure guards in packages/db/tests/query/includes-oracle.property.test.ts at lines 2119 and 2199 to match duplicate-alias test-owned data rather than generic Vitest “deeply equal” boilerplate; apply the same targeted message pattern at both sites so unrelated toEqual mismatches cannot satisfy the guard.🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@packages/db/tests/expected-failure.test.ts`: - Around line 58-66: Extend the expected-failure tests around expectAssertionFailure to cover guarded assertions whose underlying promise resolves, including both the checkpoint and message option branches. Assert that the guard itself rejects when the wrapped assertion resolves, while preserving the existing runtime-error message collision case. --- Nitpick comments: In `@packages/db/tests/expected-failure.test.ts`: - Around line 22-44: Update both tests around expectAssertionFailure to assert the specific rejection content rather than only Error type: verify “startup mismatch” for the wrong-checkpoint case and “projection failed” for the runtime-error case, while preserving their existing rejection expectations. In `@packages/db/tests/query/includes-oracle.property.test.ts`: - Around line 1657-1675: Remove the standalone `covers a visible relationship transition at every depth` test, including its scenario sampling and loop; the existing property test using `visibleRelationshipScenarioArbitrary` already covers the same seeded scenarios and assertion. - Around line 117-141: Refactor the action-type definitions in the level arbitrary builder around the two fc.constantFrom branches: define the shared child action list once, then derive the root list by excluding delete, preserving the existing root and child behavior while allowing new shared actions to be added in one place. - Line 2119: Update the expected-failure guards in packages/db/tests/query/includes-oracle.property.test.ts at lines 2119 and 2199 to match duplicate-alias test-owned data rather than generic Vitest “deeply equal” boilerplate; apply the same targeted message pattern at both sites so unrelated toEqual mismatches cannot satisfy the guard. In `@packages/db/tests/query/includes-temporal-oracle.test.ts`: - Line 171: Define a single LiveCollection type alias for the live-query collection, parameterized with the projected row type used by the test so live.get(...) retains a useful shape. Replace the repeated ReturnType<typeof createLiveQueryCollection> annotations in ReadinessContext, DemandCancellationContext, and ProgressiveContext with LiveCollection. - Around line 216-220: Update the async drivers around start, createDemandCancellationDriver, and createProgressiveDriver so waits on context.parentLoaded.promise, context.childLoadStarted.promise, and context.startReached.promise race against bounded timers. Reject or otherwise fail with a diagnostic checkpoint error when the timer expires, while preserving successful deferred-resolution behavior. - Around line 285-306: In the helper that creates the temporal removable post collection, add a short comment documenting that the returned wrapper around remove must remain late-bound so callers observe the reassignment performed inside sync rather than capturing the initial throwing placeholder. Keep the existing remove initialization and reassignment behavior unchanged. - Around line 230-246: Extract the shared recompute and assertEqual behavior from the three projections into a single helper, then spread or otherwise reuse that helper in readinessProjection and the projections near the other referenced sections. Keep each projection responsible only for its observe implementation while preserving the existing comparison semantics.🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
5129c761-7925-439b-8c3a-04d21b860b91📥 Commits
Reviewing files that changed from the base of the PR and between 9005885bfe5f8ac4e6d68c35b66dedaa9a27cc2f and 8ab70ea4cf6f9e07a04d104f94f0e0aa2be00b64.
📒 Files selected for processing (6)
packages/db/tests/expected-failure.test.tspackages/db/tests/expected-failure.tspackages/db/tests/query/includes-oracle.property.test.tspackages/db/tests/query/includes-temporal-oracle.test.tspackages/db/tests/trace-runner.test.tspackages/db/tests/trace-runner.ts
packages/db/tests/expected-failure.test.ts lines 58 to 66@@ -0,0 +46,21 @@46+ it(`accepts an assertion mismatch with the expected message`, async () => {47+ const guarded = expectAssertionFailure(48+ () =>49+ Promise.resolve().then(() => {50+ expect([`actual`]).toEqual([`expected`])51+ }),52+ { message: /expected/ },53+ )54+55+ await guarded()56+ })57+58+ it(`rejects runtime errors that happen to have the expected message`, async () => {59+ const runtimeError = new TypeError(`expected value is missing`)60+ const guarded = expectAssertionFailure(() => Promise.reject(runtimeError), {61+ message: /expected/,62+ })63+64+ await expect(guarded()).rejects.toBeInstanceOf(Error)65+ })66+})📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add a case where the guarded assertion resolves.
The guard exists to lock in known failures. If the underlying defect is fixed, the guarded assertion resolves and the guard must fail. That path is not covered for either the
checkpointbranch or themessagebranch.Based on learnings, test corner cases including resolved promises.
💚 Proposed additional tests
it(`rejects runtime errors that happen to have the expected message`, async () => { const runtimeError = new TypeError(`expected value is missing`) const guarded = expectAssertionFailure(() => Promise.reject(runtimeError), { message: /expected/, }) await expect(guarded()).rejects.toBeInstanceOf(Error) }) + + it(`rejects an assertion that unexpectedly passes`, async () => { + const guardedCheckpoint = expectAssertionFailure( + () => Promise.resolve(), + { checkpoint: 2 }, + ) + const guardedMessage = expectAssertionFailure(() => Promise.resolve(), { + message: /expected/, + }) + + await expect(guardedCheckpoint()).rejects.toBeInstanceOf(Error) + await expect(guardedMessage()).rejects.toBeInstanceOf(Error) + }) })📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
it(`rejects runtime errors that happen to have the expected message`, async () => { const runtimeError = new TypeError(`expected value is missing`) const guarded = expectAssertionFailure(() => Promise.reject(runtimeError), { message: /expected/, }) await expect(guarded()).rejects.toBeInstanceOf(Error) }) it(`rejects an assertion that unexpectedly passes`, async () => { const guardedCheckpoint = expectAssertionFailure( () => Promise.resolve(), { checkpoint: 2 }, ) const guardedMessage = expectAssertionFailure(() => Promise.resolve(), { message: /expected/, }) await expect(guardedCheckpoint()).rejects.toBeInstanceOf(Error) await expect(guardedMessage()).rejects.toBeInstanceOf(Error) }) })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/db/tests/expected-failure.test.ts` around lines 58 - 66, Extend the expected-failure tests around expectAssertionFailure to cover guarded assertions whose underlying promise resolves, including both the checkpoint and message option branches. Assert that the guard itself rejects when the wrapped assertion resolves, while preserving the existing runtime-error message collision case.Source: Learnings
More templates
@tanstack/angular-db
npm i https://pkg.pr.new/@tanstack/angular-db@1720@tanstack/browser-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@1720@tanstack/capacitor-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@1720@tanstack/cloudflare-durable-objects-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@1720@tanstack/db
npm i https://pkg.pr.new/@tanstack/db@1720@tanstack/db-ivm
npm i https://pkg.pr.new/@tanstack/db-ivm@1720@tanstack/db-sqlite-persistence-core
npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@1720@tanstack/electric-db-collection
npm i https://pkg.pr.new/@tanstack/electric-db-collection@1720@tanstack/electron-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@1720@tanstack/expo-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@1720@tanstack/node-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@1720@tanstack/offline-transactions
npm i https://pkg.pr.new/@tanstack/offline-transactions@1720@tanstack/powersync-db-collection
npm i https://pkg.pr.new/@tanstack/powersync-db-collection@1720@tanstack/query-db-collection
npm i https://pkg.pr.new/@tanstack/query-db-collection@1720@tanstack/react-db
npm i https://pkg.pr.new/@tanstack/react-db@1720@tanstack/react-native-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@1720@tanstack/rxdb-db-collection
npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@1720@tanstack/solid-db
npm i https://pkg.pr.new/@tanstack/solid-db@1720@tanstack/svelte-db
npm i https://pkg.pr.new/@tanstack/svelte-db@1720@tanstack/tauri-db-sqlite-persistence
npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@1720@tanstack/trailbase-db-collection
npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@1720@tanstack/vue-db
npm i https://pkg.pr.new/@tanstack/vue-db@1720commit:
8ab70eatannerlinsley merged this0b2a5a0
tannerlinsley closed this
Size Change: 0 B
Total Size: 128 kB
compressed-size-action::db-package-sizeℹ️ View Unchanged
Filename Size packages/db/dist/esm/collection/change-events.js1.44 kB packages/db/dist/esm/collection/changes.js1.43 kB packages/db/dist/esm/collection/cleanup-queue.js810 B packages/db/dist/esm/collection/events.js434 B packages/db/dist/esm/collection/index.js3.83 kB packages/db/dist/esm/collection/indexes.js1.99 kB packages/db/dist/esm/collection/lifecycle.js1.7 kB packages/db/dist/esm/collection/mutations.js2.47 kB packages/db/dist/esm/collection/state.js5.51 kB packages/db/dist/esm/collection/subscription.js3.82 kB packages/db/dist/esm/collection/sync.js2.94 kB packages/db/dist/esm/collection/transaction-metadata.js144 B packages/db/dist/esm/deferred.js207 B packages/db/dist/esm/errors.js5.13 kB packages/db/dist/esm/event-emitter.js748 B packages/db/dist/esm/index.js3.21 kB packages/db/dist/esm/indexes/auto-index.js829 B packages/db/dist/esm/indexes/base-index.js784 B packages/db/dist/esm/indexes/basic-index.js2.17 kB packages/db/dist/esm/indexes/btree-index.js2.29 kB packages/db/dist/esm/indexes/index-registry.js820 B packages/db/dist/esm/indexes/reverse-index.js557 B packages/db/dist/esm/live-query-adapter.js318 B packages/db/dist/esm/live-query-observer.js2.29 kB packages/db/dist/esm/local-only.js916 B packages/db/dist/esm/local-storage.js2.12 kB packages/db/dist/esm/optimistic-action.js359 B packages/db/dist/esm/paced-mutations.js496 B packages/db/dist/esm/proxy.js3.75 kB packages/db/dist/esm/query/builder/functions.js1.47 kB packages/db/dist/esm/query/builder/index.js5.84 kB packages/db/dist/esm/query/builder/ref-proxy.js1.24 kB packages/db/dist/esm/query/compiler/evaluators.js1.89 kB packages/db/dist/esm/query/compiler/expressions.js430 B packages/db/dist/esm/query/compiler/group-by.js3.56 kB packages/db/dist/esm/query/compiler/index.js6.67 kB packages/db/dist/esm/query/compiler/joins.js2.5 kB packages/db/dist/esm/query/compiler/lazy-targets.js923 B packages/db/dist/esm/query/compiler/order-by.js1.74 kB packages/db/dist/esm/query/compiler/select.js1.53 kB packages/db/dist/esm/query/effect.js4.77 kB packages/db/dist/esm/query/expression-helpers.js1.43 kB packages/db/dist/esm/query/ir.js1.25 kB packages/db/dist/esm/query/live-query-collection.js360 B packages/db/dist/esm/query/live/collection-config-builder.js9.24 kB packages/db/dist/esm/query/live/collection-registry.js264 B packages/db/dist/esm/query/live/collection-subscriber.js1.93 kB packages/db/dist/esm/query/live/internal.js145 B packages/db/dist/esm/query/live/utils.js1.81 kB packages/db/dist/esm/query/optimizer.js2.92 kB packages/db/dist/esm/query/predicate-utils.js2.97 kB packages/db/dist/esm/query/query-once.js359 B packages/db/dist/esm/query/subset-dedupe.js960 B packages/db/dist/esm/scheduler.js1.3 kB packages/db/dist/esm/SortedMap.js1.3 kB packages/db/dist/esm/strategies/debounceStrategy.js247 B packages/db/dist/esm/strategies/queueStrategy.js428 B packages/db/dist/esm/strategies/throttleStrategy.js246 B packages/db/dist/esm/transactions.js3.04 kB packages/db/dist/esm/utils.js927 B packages/db/dist/esm/utils/array-utils.js273 B packages/db/dist/esm/utils/browser-polyfills.js304 B packages/db/dist/esm/utils/btree.js5.61 kB packages/db/dist/esm/utils/comparison.js1.15 kB packages/db/dist/esm/utils/cursor.js457 B packages/db/dist/esm/utils/index-optimization.js2.39 kB packages/db/dist/esm/utils/type-guards.js157 B packages/db/dist/esm/utils/uuid.js449 B packages/db/dist/esm/virtual-props.js360 B Size Change: 0 B
Total Size: 3.81 kB
compressed-size-action::react-db-package-sizeℹ️ View Unchanged
Filename Size packages/react-db/dist/esm/index.js249 B packages/react-db/dist/esm/useLiveInfiniteQuery.js1.32 kB packages/react-db/dist/esm/useLiveQuery.js920 B packages/react-db/dist/esm/useLiveQueryEffect.js355 B packages/react-db/dist/esm/useLiveSuspenseQuery.js567 B packages/react-db/dist/esm/usePacedMutations.js401 B
Sign in to join this conversation.
📝 Walkthrough
Walkthrough#
The PR adds checkpoint-aware trace assertion errors and a reusable expected-failure helper. It expands includes oracle tests with deterministic batch, relationship-transition, and temporal-loading scenarios.
Changes#
Includes oracle coverage
packages/db/tests/trace-runner.ts,packages/db/tests/trace-runner.test.ts,packages/db/tests/expected-failure.ts,packages/db/tests/expected-failure.test.tspackages/db/tests/query/includes-oracle.property.test.tspackages/db/tests/query/includes-temporal-oracle.test.tsEstimated code review effort: 4 (Complex) | ~60 minutes
Possibly related PRs
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share