Skip to content

fix(db): reject negative limits before changing queries or windows - #2333

Merged
KyleAMathews merged 7 commits into
mainfrom
codex/reject-negative-limits
Nov 2, 2026
Merged

KyleAMathews merged 7 commits into
mainfrom
codex/reject-negative-limits

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

The query builder now rejects .limit(-2) with a synchronous RangeError. Ordinary ordered list queries also reject negative setWindow limits before changing their window or source demand. Both paths previously admitted negative widths, which could produce inconsistent window deltas.

Zero, including -0, positive integer limits, Infinity, and negative offsets retain their existing behavior. Existing findOne, ordering, and reentrancy guards keep their error precedence. One internal validator checks both entry points. This adds no public API.

Shared clause merging and condition validation remove repeated builder code. The refactor also removes redundant source validation and unreachable window bookkeeping. These reductions offset the new admission checks.

This follows the negative-limit question found during merged #2316. That PR already resolved the page-window optimization in #2291.

🔬 Oracle Coverage

The pagination owner gains a limit-admission companion. Its independent sign law checks admission through six public receivers. Rejected operations must preserve captured public observations.

  • Law: The maintainer decision on 2026-11-02 requires synchronous negative-limit rejection before query, window, or demand changes. Public JSDoc requires RangeError after the existing query-shape and reentrancy guards pass.
  • Reach: Builder, unstarted, ready, initial-pending, move-pending, and replay-pending receivers each reach their declared states in 21 histories per campaign. Fixed and random campaigns retain valid neighbors, partial bounds, held work, and subsequent source updates. Each generated negative held move checks successful and failed acquisition settlement.
  • RED: The oracle-only commit 7ecf97dff precedes the production fix. Unchanged production fails all 12 negative campaigns across the six receivers. All 12 valid campaigns pass.
  • GREEN: All 772 tests in 22 selected files pass. Test TypeScript compilation, changed-file lint, the private-mangle check, formatting, and consumer error checks also pass.
  • Mutant: Eight hostile mutations fail their intended comparisons. Two additional mutations that throw Error or undefined each fail all 12 negative campaigns at the error-class comparison. Request-generation corruption fails the settlement comparison with a reduced replayable history. Failed-move rollback corruption fails the next-use comparison. A valid task-scheduled settlement control passes.
  • Limits: Evidence covers ordinary ordered list queries, fully installed finite source rows, and controlled acquisition settlement. It excludes provider delivery, framework error timing, raw IR, NaN, positive fractions, and raw IVM negative-width semantics.

Run the admission comparison from packages/db:

TANSTACK_DB_ORACLE_STATISTICS=1 pnpm exec vitest run tests/query/pagination-oracle.property.test.ts -t 'negative limit admission' --maxWorkers=2 --coverage.enabled=false

The versioned evidence record preserves exact commands, review findings, mutants, reach counts, and reviewed source hashes. The coverage map records the boundary. The committed error page now includes error 261. A CLI check protects that artifact from catalog drift. No oracle run budget decreased.

📦 Shipped Size

Comparison against merged baseline 30e85464 includes the negative-limit fix:

Bundle Gzip delta Brotli delta
Typical app −6 bytes (96,323 → 96,317) −209 bytes
Full db exports −21 bytes +27 bytes

All eight app scenarios shrink in gzip. Brotli varies by scenario. Tests and evidence do not enter the production bundles.

pnpm size:compare --packages db --base 30e85464ed2b9b12c5f10981a062427a1fc8daaa --exact-base --files

✅ Checklist

  • I have tested this code locally with pnpm test.

The complete root command did not run. Local validation used the selected suites and checks recorded above.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

The existing changeset patches @tanstack/db.

Summary by CodeRabbit

  • Bug Fixes
    • Negative limits passed to .limit() or setWindow() now throw a RangeError immediately, without changing the query or active window.
    • Zero limits, including negative zero, remain valid, and negative offsets retain their existing behavior.
  • Documentation
    • Clarified when negative limits are rejected and which limit and offset values remain supported.

Test added 5 commits November 2, 2026 11:29
Preserve query construction and window admission while removing duplicated merges, condition validation, and unreachable source/window bookkeeping. Strengthen the admission oracle to require the documented RangeError.

Law: existing immutable builder and window admission contracts. Reach: all six admission receivers retain 21 histories per campaign. RED: ordinary Error and throw-undefined mutants fail all 12 negative campaigns at the shared error-class comparison; current production was already correct. GREEN: 754 tests, test typecheck, changed lint, mangle check and consumer error erasure pass. Mutant: both wrong error-class implementations were restored. Limits: existing admission domain and observation cuts are unchanged; no raw-IR accessor timing or numeric-policy expansion.
@changeset-bot

changeset-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e55c530

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@tanstack/db Patch
@tanstack/angular-db Patch
@tanstack/capacitor-db-sqlite-persistence-e2e-app Patch
@tanstack/convex-db-collection Patch
@tanstack/db-sqlite-persistence-core Patch
@tanstack/electric-db-collection Patch
@tanstack/expo-db-sqlite-persistence-e2e-app Patch
@tanstack/powersync-db-collection Patch
@tanstack/preact-db Patch
@tanstack/react-db Patch
@tanstack/rxdb-db-collection Patch
@tanstack/solid-db Patch
@tanstack/svelte-db Patch
@tanstack/tauri-db-sqlite-persistence-e2e-app Patch
@tanstack/trailbase-db-collection Patch
@tanstack/vue-db Patch
@tanstack/browser-db-sqlite-persistence Patch
@tanstack/capacitor-db-sqlite-persistence Patch
@tanstack/cloudflare-durable-objects-db-sqlite-persistence Patch
@tanstack/electron-db-sqlite-persistence Patch
@tanstack/expo-db-sqlite-persistence Patch
@tanstack/node-db-sqlite-persistence Patch
@tanstack/react-native-db-sqlite-persistence Patch
@tanstack/tauri-db-sqlite-persistence Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7cf5c83f-88a5-4ac6-afcd-46ae2bcf978b
Commits

Reviewing files that changed from the base of the PR and between 7fd0d09 and e55c530.

Files selected for processing: 8
  • docs/contributing/oracle-coverage.md
  • docs/contributing/oracle-reviews/2026-11-02-negative-limit-admission.md
  • docs/errors.md
  • packages/db/src/query/builder/index.ts
  • packages/db/src/query/live/collection-config-builder.ts
  • packages/db/tests/generate-error-docs.test.ts
  • packages/db/tests/oracle-replay.test.ts
  • packages/db/tests/query/limit-admission-oracle.ts
Files skipped from review as they are similar to previous changes: 2
  • docs/contributing/oracle-coverage.md
  • docs/contributing/oracle-reviews/2026-11-02-negative-limit-admission.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

Walkthrough

Negative limits now throw synchronously when passed to .limit() or setWindow(), before query or window state changes. Zero limits and negative offsets remain supported. The query builder also consolidates clause updates and condition conversion, with oracle coverage for admission and recovery across several query states.

Changes: Query limit admission

Layer / File(s) Summary
Query builder clause updates
packages/db/src/query/builder/index.ts, packages/db/mangle-cache.json
Query builder methods merge clause patches through _clone. Source-reference lookup and condition conversion are shared. The obsolete _createRefForSource mangle-cache entry is removed.
Negative limit validation
packages/db/src/query/validate-limit.ts, packages/db/src/query/builder/index.ts, packages/db/src/query/live/collection-config-builder.ts, packages/db/tests/fixtures/error-site-messages.json, packages/db/src/query/live/ARCHITECTURE.md, docs/errors.md, .changeset/reject-negative-limits.md
A shared validator rejects negative values at .limit() and setWindow() entry points. Documentation and the changeset record the behavior, including support for zero limits and negative offsets.
Admission oracle and replay
packages/db/tests/query/limit-admission-oracle.ts, packages/db/tests/query/pagination-oracle.property.test.ts, packages/db/tests/oracle-config.ts, packages/db/tests/oracle-replay-manifest.ts, packages/db/tests/oracle-replay.test.ts, packages/db/tests/generate-error-docs.test.ts, docs/contributing/oracle-coverage.md, docs/contributing/oracle-reviews/*
Oracle campaigns cover negative and valid limits across builder and live-query states. Replay configuration and documentation record campaign results, tested scope, and exclusions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: samwillis

Merge Risk: Minimal · up to e55c5

No identified issue blocks merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "fix(db): reject negative limits before changing queries or windows" matches the main change. The changeset shows that the query builder's .limit() and setWindow() now reject negative limits…
Description check Passed The description follows the template. It has the Changes section, which explains the new RangeError for negative limits and the setWindow behavior. It has an Oracle Coverage section that names the pag…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(db): reject negative limits before changing queries or windows" matches the main change. The changeset shows that the query builder's .limit() and setWindow() now reject negative limits before changing state. The title is specific, concise, and follows a conventional commit style. It does not cover the refactors or the oracle test additions, which is expected.

Full details: Description check

Explanation

The description follows the template. It has the Changes section, which explains the new RangeError for negative limits and the setWindow behavior. It has an Oracle Coverage section that names the pagination owner and the limit-admission companion. It states the law, the reach across six receivers, the RED/GREEN results, mutants, and remaining limits, as the bug-fix guidance requires. It has the Checklist and Release Impact sections. The checklist item for local tests is unchecked, and the author states the complete root test command did not run. This gap is disclosed, so it does not make the description incomplete. The Oracle Coverage section is dense, but it contains the required evidence.

Full details: Docstring Coverage

Explanation

Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 9 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Incremental update benchmark

Comparing ac9bf839f (this PR) against d9d0a8e50 (base). Write times are per-write medians over 100 iterations (20 warmup writes). Cold hydrate is one timed first load of each query.

Overall median write time vs base: 1.00× · cold hydrate time: 1.04× (geometric mean of per-case ratios; lower is faster).

Writes: 3 regression(s), 4 improvement(s) (threshold: ±20% and >0.05ms).

Cold hydrate: 3 regression(s), 0 improvement(s) (threshold: ±50% and >5ms).

Per-case flags are noisy on shared runners. Read the geometric means first.

Writes

Query Δ median write time (geomean) Best case Worst case Flags
list: newest 50 open +0.3% -30.7% +15.5% 1 🟢
list + author +0.6% -30.6% +51.3% 1 🔴 1 🟢
list + comment count +0.9% -10.0% +26.5% 1 🔴
list + 3 recent comments -0.2% -47.3% +56.9% 1 🔴 1 🟢
issue detail + comments -4.4% -33.7% +10.6% 1 🟢

Cold hydrate

Query Δ cold hydrate time (geomean) Best case Worst case Flags
list: newest 50 open +1.8% -52.1% +94.5% 2 🔴
list + author +7.2% -15.1% +96.6% —
list + comment count -3.7% -34.1% +25.6% —
list + 3 recent comments +16.3% -8.8% +69.6% 1 🔴
issue detail + comments +4.4% -14.7% +29.3% —

Each row aggregates the 14.4 scale/index/write-mode configurations of that query; per-configuration tables below.

100 rows/collection | source indexes: none | synced writes — geomean 0.94×, cold 0.98×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.272ms 0.242ms -11.1% 0.465ms 0.399ms -14.1% 16.180ms 16.949ms +4.8%
list: newest 50 open 0.589ms 0.626ms +6.2% 0.956ms 0.975ms +2.0% 8.584ms 5.820ms -32.2%
list + author 0.247ms 0.260ms +5.2% 0.376ms 0.423ms +12.6% 15.634ms 17.034ms +9.0%
list + comment count 0.411ms 0.406ms -1.2% 0.666ms 0.655ms -1.6% 14.877ms 14.747ms -0.9%
list + 3 recent comments 0.267ms 0.275ms +2.8% 0.426ms 0.466ms +9.4% 13.012ms 11.861ms -8.8%
issue detail + comments 0.281ms 0.186ms -33.7% 0.359ms 0.324ms -9.7% 🟢 2.087ms 2.700ms +29.3%
100 rows/collection | source indexes: none | optimistic writes — geomean 1.01×, cold 0.81×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.178ms 0.168ms -5.3% 0.328ms 0.285ms -13.1% 5.870ms 2.813ms -52.1%
list: newest 50 open 0.126ms 0.127ms +1.3% 0.225ms 0.215ms -4.6% 4.666ms 2.279ms -51.2%
list + author 0.200ms 0.210ms +5.3% 0.335ms 0.346ms +3.5% 10.392ms 9.227ms -11.2%
list + comment count 0.277ms 0.256ms -7.5% 0.445ms 0.424ms -4.8% 5.587ms 7.017ms +25.6%
list + 3 recent comments 0.163ms 0.200ms +22.2% 0.280ms 0.356ms +26.8% 9.151ms 9.165ms +0.2%
issue detail + comments 0.153ms 0.142ms -7.6% 0.300ms 0.290ms -3.1% 1.492ms 1.634ms +9.6%
100 rows/collection | source indexes: manual | synced writes — geomean 0.99×, cold 1.06×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.207ms 0.209ms +0.8% 0.346ms 0.342ms -1.3% 5.237ms 4.732ms -9.6%
list: newest 50 open 0.405ms 0.413ms +1.9% 0.774ms 0.718ms -7.3% 2.631ms 4.363ms +65.9%
list + author 0.180ms 0.163ms -9.5% 0.315ms 0.305ms -3.1% 5.597ms 5.635ms +0.7%
list + comment count 0.300ms 0.293ms -2.1% 0.528ms 0.525ms -0.5% 5.392ms 5.262ms -2.4%
list + 3 recent comments 0.196ms 0.196ms -0.1% 0.373ms 0.294ms -21.1% 7.433ms 7.457ms +0.3%
issue detail + comments 0.137ms 0.144ms +4.6% 0.194ms 0.274ms +41.3% 0.794ms 0.780ms -1.7%
100 rows/collection | source indexes: manual | optimistic writes — geomean 1.01×, cold 1.04×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.136ms 0.135ms -0.7% 0.253ms 0.249ms -1.4% 1.851ms 1.919ms +3.7%
list: newest 50 open 0.116ms 0.118ms +2.0% 0.215ms 0.240ms +11.9% 1.501ms 2.229ms +48.5%
list + author 0.173ms 0.180ms +4.4% 0.247ms 0.316ms +28.2% 6.886ms 5.846ms -15.1%
list + comment count 0.248ms 0.235ms -5.2% 0.423ms 0.381ms -9.9% 9.711ms 7.786ms -19.8%
list + 3 recent comments 0.146ms 0.150ms +2.4% 0.243ms 0.210ms -13.6% 6.349ms 8.941ms +40.8%
issue detail + comments 0.126ms 0.132ms +4.8% 0.157ms 0.165ms +5.1% 0.810ms 0.691ms -14.7%
1,000 rows/collection | source indexes: none | synced writes — geomean 0.84×, cold 1.00×, 3 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.109ms 0.110ms +1.0% 0.217ms 0.194ms -10.9% 8.176ms 13.401ms +63.9% 🔴
list: newest 50 open 1.174ms 1.188ms +1.2% 1.918ms 2.215ms +15.5% 12.369ms 9.933ms -19.7%
list + author 0.202ms 0.140ms -30.6% 0.352ms 0.249ms -29.2% 🟢 46.513ms 42.775ms -8.0%
list + comment count 0.352ms 0.358ms +1.7% 0.500ms 0.575ms +14.9% 20.477ms 19.994ms -2.4%
list + 3 recent comments 0.384ms 0.202ms -47.3% 0.462ms 0.419ms -9.3% 🟢 14.130ms 13.414ms -5.1%
issue detail + comments 0.201ms 0.191ms -5.1% 0.343ms 0.227ms -33.9% 2.179ms 1.966ms -9.7%
1,000 rows/collection | source indexes: none | optimistic writes — geomean 0.91×, cold 1.14×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.182ms 0.126ms -30.7% 0.250ms 0.241ms -3.5% 🟢 6.367ms 12.384ms +94.5% 🔴
list: newest 50 open 0.090ms 0.093ms +3.2% 0.131ms 0.191ms +46.1% 7.283ms 8.612ms +18.2%
list + author 0.161ms 0.154ms -4.3% 0.273ms 0.199ms -26.9% 34.737ms 46.359ms +33.5%
list + comment count 0.212ms 0.191ms -10.0% 0.249ms 0.248ms -0.4% 18.916ms 12.463ms -34.1%
list + 3 recent comments 0.137ms 0.132ms -3.1% 0.168ms 0.230ms +36.8% 12.935ms 12.788ms -1.1%
issue detail + comments 0.125ms 0.118ms -5.8% 0.155ms 0.149ms -3.5% 1.296ms 1.436ms +10.8%
1,000 rows/collection | source indexes: manual | synced writes — geomean 0.96×, cold 1.38×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.100ms 0.105ms +5.0% 0.130ms 0.192ms +47.8% 1.578ms 1.715ms +8.7%
list: newest 50 open 0.358ms 0.362ms +1.1% 0.592ms 0.638ms +7.9% 1.412ms 2.529ms +79.1%
list + author 0.139ms 0.135ms -2.9% 0.240ms 0.242ms +0.6% 4.314ms 8.482ms +96.6%
list + comment count 0.256ms 0.237ms -7.6% 0.351ms 0.296ms -15.4% 4.595ms 4.361ms -5.1%
list + 3 recent comments 0.171ms 0.160ms -6.6% 0.208ms 0.209ms +0.4% 8.144ms 13.812ms +69.6% 🔴
issue detail + comments 0.128ms 0.114ms -10.7% 0.192ms 0.143ms -25.2% 0.553ms 0.621ms +12.2%
1,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.98×, cold 1.01×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.120ms 0.117ms -2.5% 0.156ms 0.167ms +6.8% 1.354ms 1.463ms +8.1%
list: newest 50 open 0.102ms 0.099ms -2.9% 0.145ms 0.140ms -3.6% 1.504ms 1.417ms -5.8%
list + author 0.155ms 0.146ms -5.8% 0.206ms 0.183ms -11.0% 4.203ms 4.123ms -1.9%
list + comment count 0.240ms 0.276ms +15.1% 0.387ms 0.411ms +6.2% 4.274ms 3.978ms -6.9%
list + 3 recent comments 0.145ms 0.134ms -7.2% 0.186ms 0.184ms -1.2% 5.881ms 6.744ms +14.7%
issue detail + comments 0.129ms 0.118ms -8.5% 0.180ms 0.160ms -10.8% 0.568ms 0.573ms +0.9%
10,000 rows/collection | source indexes: none | synced writes — geomean 1.10×, cold 1.00×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.098ms 0.100ms +1.7% 0.131ms 0.127ms -3.3% 79.609ms 81.090ms +1.9%
list: newest 50 open 12.018ms 12.908ms +7.4% 12.721ms 14.682ms +15.4% 84.672ms 73.521ms -13.2%
list + author 0.141ms 0.213ms +51.3% 0.279ms 0.285ms +2.1% 🔴 363.590ms 374.578ms +3.0%
list + comment count 0.239ms 0.242ms +1.2% 0.403ms 0.371ms -8.0% 88.901ms 93.435ms +5.1%
list + 3 recent comments 0.158ms 0.169ms +6.6% 0.280ms 0.325ms +16.4% 89.796ms 86.776ms -3.4%
issue detail + comments 0.114ms 0.115ms +0.9% 0.146ms 0.146ms +0.0% 6.377ms 6.784ms +6.4%
10,000 rows/collection | source indexes: none | optimistic writes — geomean 1.03×, cold 0.99×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.118ms 0.124ms +5.1% 0.158ms 0.231ms +46.0% 79.785ms 71.457ms -10.4%
list: newest 50 open 0.086ms 0.089ms +3.2% 0.130ms 0.135ms +4.4% 82.743ms 75.552ms -8.7%
list + author 0.157ms 0.159ms +1.8% 0.190ms 0.207ms +8.5% 341.001ms 341.223ms +0.1%
list + comment count 0.247ms 0.257ms +4.2% 0.296ms 0.329ms +11.2% 87.352ms 85.272ms -2.4%
list + 3 recent comments 0.138ms 0.141ms +2.9% 0.296ms 0.304ms +2.4% 75.738ms 93.416ms +23.3%
issue detail + comments 0.129ms 0.128ms -0.5% 0.160ms 0.170ms +6.4% 9.523ms 8.978ms -5.7%
10,000 rows/collection | source indexes: manual | synced writes — geomean 1.03×, cold 1.08×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.096ms 0.097ms +1.2% 0.126ms 0.125ms -0.6% 2.398ms 2.314ms -3.5%
list: newest 50 open 1.023ms 1.049ms +2.5% 1.656ms 1.211ms -26.9% 2.381ms 2.295ms -3.6%
list + author 0.128ms 0.132ms +3.0% 0.156ms 0.170ms +8.4% 5.012ms 4.940ms -1.4%
list + comment count 0.240ms 0.243ms +1.1% 0.279ms 0.280ms +0.1% 5.156ms 5.364ms +4.0%
list + 3 recent comments 0.168ms 0.167ms -0.4% 0.209ms 0.202ms -3.7% 6.680ms 8.643ms +29.4%
issue detail + comments 0.121ms 0.134ms +10.6% 0.313ms 0.226ms -27.7% 0.641ms 0.810ms +26.4%
10,000 rows/collection | source indexes: manual | optimistic writes — geomean 1.19×, cold 1.13×, 2 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.118ms 0.137ms +15.5% 0.215ms 0.243ms +13.0% 2.800ms 2.525ms -9.8%
list: newest 50 open 0.098ms 0.107ms +9.8% 0.125ms 0.152ms +21.8% 2.084ms 2.306ms +10.7%
list + author 0.151ms 0.161ms +6.8% 0.195ms 0.256ms +31.2% 5.166ms 5.963ms +15.4%
list + comment count 0.258ms 0.327ms +26.5% 0.313ms 0.636ms +103.6% 🔴 5.016ms 5.432ms +8.3%
list + 3 recent comments 0.150ms 0.235ms +56.9% 0.256ms 0.293ms +14.6% 🔴 6.052ms 10.215ms +68.8%
issue detail + comments 0.131ms 0.140ms +7.1% 0.166ms 0.194ms +16.8% 0.724ms 0.714ms -1.3%

Runner: node v24.8.0, linux 7.0.0-1017-azure, AMD EPYC 7763 64-Core Processor. Timings on shared CI runners are noisy; treat small deltas as indicative only.

@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-db

npm i https://pkg.pr.new/@tanstack/angular-db@2333

@tanstack/browser-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/browser-db-sqlite-persistence@2333

@tanstack/capacitor-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/capacitor-db-sqlite-persistence@2333

@tanstack/cloudflare-durable-objects-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/cloudflare-durable-objects-db-sqlite-persistence@2333

@tanstack/convex-db-collection

npm i https://pkg.pr.new/@tanstack/convex-db-collection@2333

@tanstack/db

npm i https://pkg.pr.new/@tanstack/db@2333

@tanstack/db-ivm

npm i https://pkg.pr.new/@tanstack/db-ivm@2333

@tanstack/db-sqlite-persistence-core

npm i https://pkg.pr.new/@tanstack/db-sqlite-persistence-core@2333

@tanstack/electric-db-collection

npm i https://pkg.pr.new/@tanstack/electric-db-collection@2333

@tanstack/electron-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/electron-db-sqlite-persistence@2333

@tanstack/expo-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/expo-db-sqlite-persistence@2333

@tanstack/node-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/node-db-sqlite-persistence@2333

@tanstack/offline-transactions

npm i https://pkg.pr.new/@tanstack/offline-transactions@2333

@tanstack/powersync-db-collection

npm i https://pkg.pr.new/@tanstack/powersync-db-collection@2333

@tanstack/preact-db

npm i https://pkg.pr.new/@tanstack/preact-db@2333

@tanstack/query-db-collection

npm i https://pkg.pr.new/@tanstack/query-db-collection@2333

@tanstack/react-db

npm i https://pkg.pr.new/@tanstack/react-db@2333

@tanstack/react-native-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/react-native-db-sqlite-persistence@2333

@tanstack/react-router-with-db

npm i https://pkg.pr.new/@tanstack/react-router-with-db@2333

@tanstack/rxdb-db-collection

npm i https://pkg.pr.new/@tanstack/rxdb-db-collection@2333

@tanstack/solid-db

npm i https://pkg.pr.new/@tanstack/solid-db@2333

@tanstack/svelte-db

npm i https://pkg.pr.new/@tanstack/svelte-db@2333

@tanstack/tauri-db-sqlite-persistence

npm i https://pkg.pr.new/@tanstack/tauri-db-sqlite-persistence@2333

@tanstack/trailbase-db-collection

npm i https://pkg.pr.new/@tanstack/trailbase-db-collection@2333

@tanstack/vue-db

npm i https://pkg.pr.new/@tanstack/vue-db@2333

commit: e55c530

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: +224 B (+0.09%)

Total Size: 239 kB

📦 View Changed
Filename Size Change
packages/db/dist/esm/query/builder/index.js 7.67 kB -52 B (-0.67%)
packages/db/dist/esm/query/live/collection-config-builder.js 8.57 kB +29 B (+0.34%)
packages/db/dist/esm/query/validate-limit.js 247 B +247 B (new file) 🆕
ℹ️ View Unchanged
Filename Size
packages/db/dist/esm/client.js 5.51 kB
packages/db/dist/esm/collection-options-brand.js 219 B
packages/db/dist/esm/collection-options.js 258 B
packages/db/dist/esm/collection/change-events.js 1.76 kB
packages/db/dist/esm/collection/changes.js 3.06 kB
packages/db/dist/esm/collection/cleanup-queue.js 828 B
packages/db/dist/esm/collection/config-errors.js 547 B
packages/db/dist/esm/collection/events.js 504 B
packages/db/dist/esm/collection/health-tree.js 698 B
packages/db/dist/esm/collection/index.js 6.23 kB
packages/db/dist/esm/collection/indexes.js 2.3 kB
packages/db/dist/esm/collection/lifecycle.js 5.59 kB
packages/db/dist/esm/collection/mutations.js 2.94 kB
packages/db/dist/esm/collection/state.js 7.69 kB
packages/db/dist/esm/collection/subscription.js 9.86 kB
packages/db/dist/esm/collection/sync.js 6.51 kB
packages/db/dist/esm/collection/validate-config.js 1.17 kB
packages/db/dist/esm/collection/validate-indexing.js 366 B
packages/db/dist/esm/deferred.js 207 B
packages/db/dist/esm/error-message.js 642 B
packages/db/dist/esm/errors.js 7.15 kB
packages/db/dist/esm/event-emitter.js 1.06 kB
packages/db/dist/esm/index.js 4.75 kB
packages/db/dist/esm/indexed-db-wrapper.js 1.91 kB
packages/db/dist/esm/indexed-db.js 3.8 kB
packages/db/dist/esm/indexes/auto-index.js 924 B
packages/db/dist/esm/indexes/base-index.js 1.92 kB
packages/db/dist/esm/indexes/basic-index.js 1.93 kB
packages/db/dist/esm/indexes/btree-index.js 1.62 kB
packages/db/dist/esm/indexes/index-registry.js 916 B
packages/db/dist/esm/indexes/reverse-index.js 1.01 kB
packages/db/dist/esm/live-query-adapter.js 845 B
packages/db/dist/esm/live-query-observer-client.js 2.21 kB
packages/db/dist/esm/live-query-observer.js 3.3 kB
packages/db/dist/esm/live-query-options.js 2.65 kB
packages/db/dist/esm/live-query-primitives.js 406 B
packages/db/dist/esm/live-query-window-binding.js 1.56 kB
packages/db/dist/esm/live-query-window-controller.js 4.02 kB
packages/db/dist/esm/local-only.js 1 kB
packages/db/dist/esm/local-storage.js 4.58 kB
packages/db/dist/esm/optimistic-action.js 359 B
packages/db/dist/esm/paced-mutations.js 1.11 kB
packages/db/dist/esm/proxy.js 3.51 kB
packages/db/dist/esm/query/builder/clone-query.js 854 B
packages/db/dist/esm/query/builder/functions.js 1.61 kB
packages/db/dist/esm/query/builder/group-keys.js 157 B
packages/db/dist/esm/query/builder/include-functions.js 229 B
packages/db/dist/esm/query/builder/query-ir.js 312 B
packages/db/dist/esm/query/builder/ref-proxy-identity.js 292 B
packages/db/dist/esm/query/builder/ref-proxy.js 1.67 kB
packages/db/dist/esm/query/builder/wrapper-identity.js 221 B
packages/db/dist/esm/query/compiler/evaluators.js 2.51 kB
packages/db/dist/esm/query/compiler/expressions.js 603 B
packages/db/dist/esm/query/compiler/find-aggregate.js 328 B
packages/db/dist/esm/query/compiler/group-by.js 4.38 kB
packages/db/dist/esm/query/compiler/grouping.js 161 B
packages/db/dist/esm/query/compiler/index.js 10.3 kB
packages/db/dist/esm/query/compiler/joins.js 3.29 kB
packages/db/dist/esm/query/compiler/lazy-targets.js 1.11 kB
packages/db/dist/esm/query/compiler/order-by.js 2.87 kB
packages/db/dist/esm/query/compiler/parent-routes.js 325 B
packages/db/dist/esm/query/compiler/query-equivalence.js 568 B
packages/db/dist/esm/query/compiler/route-metadata.js 1.45 kB
packages/db/dist/esm/query/compiler/select.js 1.66 kB
packages/db/dist/esm/query/effect.js 5.81 kB
packages/db/dist/esm/query/equality-conjunct.js 486 B
packages/db/dist/esm/query/equality-value-identity.js 736 B
packages/db/dist/esm/query/expression-helpers.js 1.61 kB
packages/db/dist/esm/query/ir-stable-identity.js 4.29 kB
packages/db/dist/esm/query/ir.js 2.26 kB
packages/db/dist/esm/query/join-conditions.js 257 B
packages/db/dist/esm/query/live-query-collection.js 391 B
packages/db/dist/esm/query/live/bucket-facade-adapter.js 3.17 kB
packages/db/dist/esm/query/live/collection-registry.js 264 B
packages/db/dist/esm/query/live/collection-subscriber.js 2.69 kB
packages/db/dist/esm/query/live/graph-scheduler.js 305 B
packages/db/dist/esm/query/live/includes-runtime.js 212 B
packages/db/dist/esm/query/live/internal.js 145 B
packages/db/dist/esm/query/live/materialized-pipeline.js 1.94 kB
packages/db/dist/esm/query/live/ordered-source-loader.js 6.53 kB
packages/db/dist/esm/query/live/public-key-reduction.js 970 B
packages/db/dist/esm/query/live/subset-demand-controller.js 2.44 kB
packages/db/dist/esm/query/live/utils.js 1.35 kB
packages/db/dist/esm/query/optimizer.js 2.95 kB
packages/db/dist/esm/query/pooled-live-query.js 5.14 kB
packages/db/dist/esm/query/pooled-source.js 219 B
packages/db/dist/esm/query/query-once.js 359 B
packages/db/dist/esm/query/runtime-reference-identity.js 630 B
packages/db/dist/esm/query/subset-dedupe.js 493 B
packages/db/dist/esm/scheduler.js 1.23 kB
packages/db/dist/esm/SortedMap.js 1.77 kB
packages/db/dist/esm/strategies/commit-completion.js 154 B
packages/db/dist/esm/strategies/debounceStrategy.js 658 B
packages/db/dist/esm/strategies/queueStrategy.js 523 B
packages/db/dist/esm/strategies/serial-pacer.js 486 B
packages/db/dist/esm/strategies/throttleStrategy.js 738 B
packages/db/dist/esm/sync-persistence.js 669 B
packages/db/dist/esm/sync-receipt.js 211 B
packages/db/dist/esm/transaction-commit-work.js 351 B
packages/db/dist/esm/transactions.js 4.66 kB
packages/db/dist/esm/utils.js 1.7 kB
packages/db/dist/esm/utils/array-utils.js 270 B
packages/db/dist/esm/utils/browser-polyfills.js 304 B
packages/db/dist/esm/utils/btree.js 3.02 kB
packages/db/dist/esm/utils/callbacks.js 219 B
packages/db/dist/esm/utils/comparison.js 1.95 kB
packages/db/dist/esm/utils/cursor.js 753 B
packages/db/dist/esm/utils/error.js 262 B
packages/db/dist/esm/utils/get-or-create.js 155 B
packages/db/dist/esm/utils/index-optimization.js 2.58 kB
packages/db/dist/esm/utils/source-record.js 140 B
packages/db/dist/esm/utils/type-guards.js 230 B
packages/db/dist/esm/utils/uuid.js 530 B
packages/db/dist/esm/virtual-props.js 400 B
packages/react-db/dist/esm/DbProvider.js 317 B
packages/react-db/dist/esm/development.js 190 B
packages/react-db/dist/esm/HydrationBoundary.js 263 B
packages/react-db/dist/esm/index.js 330 B
packages/react-db/dist/esm/source-id-bindings.js 339 B
packages/react-db/dist/esm/useLiveInfiniteQuery.js 1.45 kB
packages/react-db/dist/esm/useLiveQuery.js 3.08 kB
packages/react-db/dist/esm/useLiveQueryEffect.js 504 B
packages/react-db/dist/esm/useLiveSuspenseQuery.js 1.27 kB
packages/react-db/dist/esm/usePacedMutations.js 429 B

compressed-size-action::db-and-react-package-size

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant