Skip to content

fix(persistence): preserve metadata on implicit equal re-inserts - #2303

Open
KyleAMathews wants to merge 3 commits into
mainfrom
codex/misfits-repair-metadata
Open

KyleAMathews wants to merge 3 commits into
mainfrom
codex/misfits-repair-metadata

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

An equal source re-insert can keep accepted metadata in memory yet leave older cached metadata in SQLite. A later peer reload then restores stale metadata, even when the accepted metadata is absent. The durable insert now records the accepted metadata value or its absence whenever the source omitted an explicit metadata write.

The reported history starts with cached metadata, adds a bare hydration seed under an open source insert, then commits an independent inner equal re-insert. A later peer reload previously restored { cached: true } where the source expected no metadata. The same defect also replaces nonempty metadata from a later hydration seed.

The fix copies explicit metadata writes into the durable transaction, then supplies accepted metadata for the remaining inserted keys. Explicit writes retain priority. The source-authority map stays unchanged, so an implicit keep does not become a source metadata write.

This addresses the separate metadata counterexample recorded under #2281. The issue's multi-tab Electric row-loss and resurrection reports remain separate. The new SQLite receiver also supplies bounded evidence toward #2272.

🔬 Oracle Coverage

Primary owner: packages/db/tests/sync-metadata-session-oracle.ts. Its independent model and comparison stay unchanged. Both receiving drivers use the shared generated histories and judgment.

The declared bug class is an equal re-insert persisting metadata that differs from the accepted metadata, including absence and later hydration seeds. The generated seed/re-insert/reload histories, controlled/native production paths, and observation cuts below bound the closure evidence. The broader #2272 host, transport, leadership, and notice-shape gaps remain receiving work. This PR claims no closure for those regimes, and the accepted metadata law still applies there.

  • Law: An independent equal re-insert keeps accepted row metadata without becoming a source metadata write. Its durable replacement must preserve that same value, including absence and a later hydration seed. Authority: sync metadata decisions 4, 5, 6, 8, 9, 14, 15, and 18, plus the glossary's hydration-seed contract.
  • Reach: Controlled and native hosts each complete 40 fixed and 40 random histories in partial, full-row, and on-demand lanes. The grammar varies keys, seed contents and placement, explicit metadata, repeated re-inserts, core holds, outer transaction disposition, and named/full-reload notices. Fixed seed 527962096 reaches 40 inner commits, 21 named notices, and 19 full reloads per host/lane. Each also reaches two completed bare-key-1 implicit keeps and two completed non-bare implicit keeps through reload. Fixed campaigns enforce these scarce completed states. Random campaigns measure them. All older guards still apply to both campaigns.
  • RED: Extended controlled tests fail on unchanged production before the fix at seed 2281001, path 7:0. Native SQLite generation also fails, at path 7:0:0, alongside three failing native replays. Failures compare the source's accepted metadata with the unchanged model. Eager lanes fail at peer step 6. Native on-demand can fail earlier at inner commit step 5 because real coordination reads storage sooner.
  • GREEN: Both hosts pass their paired campaigns and original replays. The final shared reach helper passes 102,912 equivalence comparisons across 2,304 constructive histories. Final integration reruns the host campaigns and direct replays with that helper. Scoped types, lint, formatting, pnpm lint:changed, and combined integration checks pass. This change preserves all prior budgets, guards, and comparisons.
  • Mutant: Restoring the original explicit-only durable metadata map fails both hosts at the source-metadata comparison. Always deleting implicit metadata also fails both hosts when a later seed supplies nonempty metadata. Forcing explicit inner metadata passes 40 product comparisons per host but fails the completed implicit-keep reach guards. The new guards followed initial production editing, after review exposed zero bare-key-1 reach in the original fixed seed.
  • Limits: The native receiver uses two persisted Collections, separate DbClients, two production BrowserCollectionCoordinators, Node BroadcastChannel/Web Locks, and one native SQLite database. It asserts actual received notice types. The oracle checks source metadata after every action. It checks rows, receipts, and durable rows after settlement. This covers one process and constructive histories with core holds. Chromium OPFS, Electron IPC, transport loss, leadership turnover, all notice shapes, and broader store/read-hold combinations remain open under Oracle: two persisted Collections over one SQLite database with real coordinators #2272.

The historical RED commands run from packages/db-sqlite-persistence-core with unchanged production and the extended tests:

pnpm exec vitest run --coverage.enabled=false --typecheck.enabled=false --maxWorkers=1 --silent=false --disableConsoleIntercept tests/sync-metadata-session-persisted.test.ts -t 'inner re-insert over a seed|inserted metadata across peer reloads \(fixed\)'
pnpm exec vitest run --coverage.enabled=false --typecheck.enabled=false --maxWorkers=1 --silent=false --disableConsoleIntercept tests/sync-metadata-session-sqlite.test.ts -t 'histories through SQLite \(fixed\)'

The GREEN host command runs both campaigns and the original receiving replays:

pnpm exec vitest run --coverage.enabled=false --typecheck.enabled=false --maxWorkers=1 --silent=false --disableConsoleIntercept tests/sync-metadata-session-persisted.test.ts tests/sync-metadata-session-sqlite.test.ts -t 'inserted metadata across peer reloads|histories through SQLite|seed/re-insert/reload replay through SQLite|a reload after an inner re-insert over a seed'

✅ Checklist

  • I have tested this code locally with pnpm test.
  • Focused oracle campaigns and replays, scoped types, lint, formatting, integration checks, and size comparison passed.

Local verification targeted this change's metadata law, receiving drivers, and neighboring hydration/reload contracts. The full workspace pnpm test command was not run locally. That command spans all packages and the IndexedDB package suite, so the unchecked box records the narrower local validation.

🚀 Release Impact

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

Patch release for @tanstack/db-sqlite-persistence-core. Package gzip changes by +56 bytes and Brotli by +35 bytes. The persisted module adds 173 minified bytes. Existing application-size scenarios do not import persistence, so their unchanged size does not measure this fix.

Related: #2281 (metadata comment only), #2272 (bounded receiving coverage), and #2298 (separate multi-tab fix).

Test added 3 commits October 29, 2026 14:20
Snapshot accepted row metadata for durable inserts that omit explicit metadata
writes. Keep explicit metadata writes authoritative and avoid attributing the
preserved metadata to the source. Share completed-reach classification between
the controlled and native SQLite receiving drivers.

Law: Sync metadata session decisions4,5,6,8,9,14,15,18 in
docs/contributing/oracle-reviews/2026-10-22-sync-metadata-session.md, the implicit
row-metadata rules, and glossary hydration-seed contract. An inner equal
re-insert preserves accepted metadata through persistence and peer reload.
Reach: Each controlled/native host campaign completes40 histories in each of
three lanes. Fixed seed527962096 reaches2 completed bare-key1 implicit keeps
and2 completed non-bare keeps per lane, with21 named/19 fullreload notices.
RED: M01 controlled extended owner fails unchanged parent production at
seed2281001/path7:0; M06/M07 native SQLite receiving replays/property fail the
same metadata law, generated path7:0:0.
GREEN: M08/M09 paired40-run campaigns and receiving replays pass. H02 repeats
both hosts with the shared helper; H01b proves final-helper equivalence over
2304 histories/102912 comparisons. Final types/lint/format pass.
Mutant: Original durable-metadata map and always-delete rival both fail the
shared metadata comparison in controlled/native generated histories. An
all-explicit-inner grammar ablation fails the completed implicit-keep reaches.
Limits: One process/native SQLite with two production coordinators. No OPFS,
Electron IPC, transport-loss/leadership-turnover or broader2272 claim. Random
scarce reach is measured; fixed guards enforce both scarce branches. Host runs
precede only an explicit terminal undefined return, linked by exact equivalence.
@changeset-bot

changeset-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ea769ec

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

This PR includes changesets to release 12 packages
Name Type
@tanstack/db-sqlite-persistence-core 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
@tanstack/capacitor-db-sqlite-persistence-e2e-app Patch
@tanstack/expo-db-sqlite-persistence-e2e-app Patch
@tanstack/tauri-db-sqlite-persistence-e2e-app 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 Oct 29, 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: 80c0a63c-f82a-448a-82d8-6f37ceda1314
Commits

Reviewing files that changed from the base of the PR and between bea84cd and ea769ec.

Files selected for processing: 8
  • .changeset/preserve-implicit-reinsert-metadata.md
  • docs/contributing/oracle-coverage.md
  • packages/db-sqlite-persistence-core/src/persisted.ts
  • packages/db-sqlite-persistence-core/tests/sync-metadata-session-persisted.test.ts
  • packages/db-sqlite-persistence-core/tests/sync-metadata-session-sqlite.test.ts
  • packages/db/tests/oracle-config.ts
  • packages/db/tests/oracle-replay-manifest.ts
  • packages/db/tests/sync-metadata-session-oracle.ts

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

Walkthrough

Persisted transactions now record current row metadata for inserts without explicit metadata writes. New generated and replay tests exercise seed, re-insert, and peer-reload histories in controlled persisted lanes and real SQLite-backed lanes.

Changes: Metadata Reinsertion and Reload

Layer / File(s) Summary
Persist metadata for implicit re-inserts
packages/db-sqlite-persistence-core/src/persisted.ts, .changeset/preserve-implicit-reinsert-metadata.md
Insert operations without explicit metadata writes now add a metadata set or delete based on the current row value. Explicit writes remain authoritative.
Define seed and re-insert histories
packages/db/tests/sync-metadata-session-oracle.ts
The shared oracle adds generated and fixed histories, plus a classifier for completed bare and non-bare seed regimes.
Exercise persisted peer lanes
packages/db-sqlite-persistence-core/tests/sync-metadata-session-persisted.test.ts, packages/db/tests/oracle-config.ts, packages/db/tests/oracle-replay-manifest.ts
Replay and generated campaigns cover peer, full-row peer, and on-demand lanes. The persisted property is added to oracle configuration and replay ownership.
Exercise SQLite-backed receiving
packages/db-sqlite-persistence-core/tests/sync-metadata-session-sqlite.test.ts, docs/contributing/oracle-coverage.md
SQLite-backed replay and generated campaigns cover partial-row, full-row, and on-demand lanes with two coordinated collections. The coverage record describes the campaigns and remaining host and transport gaps.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Possibly related issues

  • Issue 2272 — Adds a real two-Collection SQLite receiving campaign with production coordinators.
  • Issue 2281 — Addresses the recorded metadata counterexample. Deleted-row resurrection behavior remains outside this change.

Suggested reviewers: nabil372

Merge Risk: Minimal · up to ea769

No actionable issue identified in this change remains before merge; normal checks still apply.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% 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(persistence): preserve metadata on implicit equal re-inserts" matches the main change. The PR makes durable inserts record accepted row metadata, or its absence, when the source omits a…
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.
Description check Passed The description follows the repository template and covers the required sections. It states the change: a durable insert now records accepted metadata, or its absence, when the source omits an explici…
Full details: Title check

Explanation

The title "fix(persistence): preserve metadata on implicit equal re-inserts" matches the main change. The PR makes durable inserts record accepted row metadata, or its absence, when the source omits an explicit metadata write. The title is concise, uses a conventional type prefix, and names the affected area and behavior.

Full details: Description check

Explanation

The description follows the repository template and covers the required sections. It states the change: a durable insert now records accepted metadata, or its absence, when the source omits an explicit metadata write. The Oracle Coverage section names the owner (packages/db/tests/sync-metadata-session-oracle.ts), gives the law, reach, RED/GREEN, mutant, and limits, and cites the authority decisions. The Release Impact section checks the changeset box and explains the size change. The unchecked 'pnpm test' box is explained by the narrower local validation. The description is mostly complete and specific.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% 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 2 functions across 6 files. (2 skipped: 2 unsupported.)

Resolution

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

Finishing Touches: 💡 1
📝 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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Incremental update benchmark

Comparing 390c6418d (this PR) against bea84cd45 (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.01× · cold hydrate time: 0.96× (geometric mean of per-case ratios; lower is faster).

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

Cold hydrate: 0 regression(s), 1 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 -3.2% -38.3% +44.7% —
list + author +1.1% -10.8% +53.5% 1 🔴
list + comment count +2.4% -5.4% +13.5% —
list + 3 recent comments +0.4% -5.4% +11.9% —
issue detail + comments +8.2% -7.7% +68.0% 1 🔴

Cold hydrate

Query Δ cold hydrate time (geomean) Best case Worst case Flags
list: newest 50 open -4.6% -58.6% +66.3% —
list + author +0.8% -64.3% +105.7% —
list + comment count -1.3% -40.1% +48.4% —
list + 3 recent comments -11.9% -71.9% +36.4% 1 🟢
issue detail + comments -0.7% -39.8% +72.8% —

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.98×, cold 1.02×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.222ms 0.210ms -5.0% 0.397ms 0.339ms -14.7% 14.812ms 16.394ms +10.7%
list: newest 50 open 0.534ms 0.492ms -7.9% 0.864ms 0.947ms +9.7% 3.447ms 4.323ms +25.4%
list + author 0.204ms 0.216ms +5.8% 0.356ms 0.363ms +2.1% 9.682ms 9.796ms +1.2%
list + comment count 0.346ms 0.348ms +0.6% 0.548ms 0.527ms -3.7% 13.142ms 12.748ms -3.0%
list + 3 recent comments 0.237ms 0.225ms -5.0% 0.393ms 0.314ms -20.1% 10.976ms 9.864ms -10.1%
issue detail + comments 0.165ms 0.170ms +3.2% 0.273ms 0.289ms +5.8% 2.231ms 2.047ms -8.2%
100 rows/collection | source indexes: none | optimistic writes — geomean 1.04×, cold 1.04×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.148ms 0.149ms +0.6% 0.232ms 0.245ms +5.5% 1.762ms 2.355ms +33.7%
list: newest 50 open 0.096ms 0.100ms +4.0% 0.147ms 0.152ms +3.0% 1.515ms 2.137ms +41.1%
list + author 0.186ms 0.166ms -10.8% 0.284ms 0.273ms -3.9% 3.558ms 3.987ms +12.0%
list + comment count 0.240ms 0.254ms +5.8% 0.404ms 0.406ms +0.5% 5.580ms 3.994ms -28.4%
list + 3 recent comments 0.190ms 0.193ms +1.3% 0.316ms 0.290ms -8.2% 6.414ms 6.829ms +6.5%
issue detail + comments 0.143ms 0.185ms +29.6% 0.254ms 0.296ms +16.7% 1.323ms 1.032ms -22.0%
100 rows/collection | source indexes: manual | synced writes — geomean 0.98×, cold 1.02×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.159ms 0.111ms -30.2% 0.232ms 0.174ms -25.0% 3.101ms 3.121ms +0.7%
list: newest 50 open 0.402ms 0.475ms +18.3% 0.644ms 0.800ms +24.2% 1.997ms 1.426ms -28.6%
list + author 0.137ms 0.138ms +0.6% 0.261ms 0.263ms +1.1% 2.599ms 2.676ms +3.0%
list + comment count 0.252ms 0.257ms +2.1% 0.477ms 0.439ms -8.1% 3.241ms 4.810ms +48.4%
list + 3 recent comments 0.174ms 0.173ms -1.1% 0.285ms 0.263ms -7.6% 4.810ms 5.285ms +9.9%
issue detail + comments 0.127ms 0.131ms +3.0% 0.247ms 0.195ms -21.1% 0.663ms 0.609ms -8.2%
100 rows/collection | source indexes: manual | optimistic writes — geomean 1.09×, cold 1.34×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.111ms 0.110ms -0.2% 0.185ms 0.162ms -12.8% 1.538ms 1.737ms +12.9%
list: newest 50 open 0.089ms 0.098ms +10.1% 0.154ms 0.184ms +19.6% 0.883ms 1.008ms +14.1%
list + author 0.146ms 0.154ms +5.9% 0.239ms 0.234ms -2.1% 2.416ms 4.971ms +105.7%
list + comment count 0.230ms 0.261ms +13.5% 0.373ms 0.379ms +1.5% 4.531ms 4.983ms +10.0%
list + 3 recent comments 0.131ms 0.147ms +11.9% 0.183ms 0.244ms +33.6% 4.846ms 5.492ms +13.3%
issue detail + comments 0.111ms 0.127ms +14.1% 0.153ms 0.155ms +1.2% 0.457ms 0.791ms +72.8%
1,000 rows/collection | source indexes: none | synced writes — geomean 1.20×, cold 0.83×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.095ms 0.138ms +44.7% 0.178ms 0.198ms +11.1% 6.668ms 7.397ms +10.9%
list: newest 50 open 1.113ms 1.090ms -2.1% 2.118ms 2.153ms +1.6% 8.100ms 6.639ms -18.0%
list + author 0.108ms 0.113ms +4.6% 0.142ms 0.163ms +14.2% 20.038ms 18.652ms -6.9%
list + comment count 0.206ms 0.232ms +13.0% 0.273ms 0.326ms +19.3% 16.476ms 11.633ms -29.4%
list + 3 recent comments 0.312ms 0.334ms +7.1% 0.406ms 0.401ms -1.2% 15.836ms 9.874ms -37.7%
issue detail + comments 0.135ms 0.226ms +68.0% 0.257ms 0.343ms +33.5% 🔴 1.856ms 1.586ms -14.6%
1,000 rows/collection | source indexes: none | optimistic writes — geomean 1.02×, cold 0.88×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.156ms 0.146ms -6.3% 0.270ms 0.214ms -20.8% 10.797ms 7.716ms -28.5%
list: newest 50 open 0.079ms 0.101ms +28.3% 0.124ms 0.140ms +13.5% 10.466ms 8.050ms -23.1%
list + author 0.137ms 0.125ms -8.8% 0.230ms 0.177ms -22.7% 20.299ms 24.001ms +18.2%
list + comment count 0.200ms 0.203ms +1.6% 0.301ms 0.250ms -16.9% 14.351ms 8.590ms -40.1%
list + 3 recent comments 0.125ms 0.126ms +0.8% 0.164ms 0.163ms -1.2% 9.942ms 9.770ms -1.7%
issue detail + comments 0.114ms 0.113ms -0.9% 0.148ms 0.147ms -0.1% 1.215ms 1.441ms +18.6%
1,000 rows/collection | source indexes: manual | synced writes — geomean 0.96×, cold 0.95×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.086ms 0.078ms -9.2% 0.114ms 0.107ms -6.5% 1.282ms 1.077ms -16.0%
list: newest 50 open 0.339ms 0.334ms -1.6% 0.602ms 0.617ms +2.5% 0.865ms 1.438ms +66.3%
list + author 0.114ms 0.106ms -6.8% 0.200ms 0.193ms -3.5% 5.088ms 1.814ms -64.3%
list + comment count 0.240ms 0.238ms -1.0% 0.313ms 0.389ms +24.4% 3.008ms 2.911ms -3.2%
list + 3 recent comments 0.158ms 0.153ms -3.1% 0.279ms 0.214ms -23.4% 4.999ms 6.821ms +36.4%
issue detail + comments 0.113ms 0.113ms -0.7% 0.142ms 0.207ms +46.0% 0.484ms 0.542ms +12.0%
1,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.96×, cold 1.07×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.105ms 0.096ms -8.4% 0.191ms 0.176ms -8.1% 0.837ms 0.868ms +3.7%
list: newest 50 open 0.082ms 0.077ms -6.4% 0.123ms 0.160ms +30.8% 0.903ms 1.002ms +11.0%
list + author 0.128ms 0.122ms -5.4% 0.181ms 0.158ms -13.1% 1.882ms 1.909ms +1.4%
list + comment count 0.206ms 0.206ms -0.2% 0.243ms 0.253ms +4.4% 2.919ms 4.043ms +38.5%
list + 3 recent comments 0.129ms 0.127ms -1.0% 0.164ms 0.160ms -2.4% 4.684ms 4.472ms -4.5%
issue detail + comments 0.118ms 0.117ms -1.0% 0.201ms 0.198ms -1.1% 0.482ms 0.476ms -1.4%
10,000 rows/collection | source indexes: none | synced writes — geomean 1.09×, cold 0.93×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.079ms 0.074ms -6.2% 0.103ms 0.135ms +30.3% 71.419ms 64.086ms -10.3%
list: newest 50 open 9.986ms 10.864ms +8.8% 10.892ms 14.663ms +34.6% 63.525ms 69.564ms +9.5%
list + author 0.121ms 0.185ms +53.5% 0.220ms 0.229ms +4.0% 🔴 192.855ms 234.304ms +21.5%
list + comment count 0.237ms 0.229ms -3.6% 0.453ms 0.393ms -13.4% 70.852ms 73.401ms +3.6%
list + 3 recent comments 0.139ms 0.142ms +2.0% 0.184ms 0.236ms +28.1% 86.778ms 75.146ms -13.4%
issue detail + comments 0.102ms 0.110ms +7.3% 0.126ms 0.161ms +27.1% 9.567ms 5.763ms -39.8%
10,000 rows/collection | source indexes: none | optimistic writes — geomean 0.95×, cold 1.06×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.107ms 0.112ms +5.0% 0.198ms 0.200ms +0.8% 60.784ms 59.548ms -2.0%
list: newest 50 open 0.110ms 0.068ms -38.3% 0.160ms 0.109ms -31.6% 60.347ms 51.321ms -15.0%
list + author 0.132ms 0.131ms -0.4% 0.211ms 0.257ms +21.9% 195.816ms 216.683ms +10.7%
list + comment count 0.227ms 0.244ms +7.8% 0.295ms 0.366ms +23.9% 76.330ms 103.148ms +35.1%
list + 3 recent comments 0.122ms 0.123ms +1.6% 0.175ms 0.173ms -0.8% 69.962ms 73.033ms +4.4%
issue detail + comments 0.113ms 0.115ms +1.5% 0.144ms 0.158ms +9.5% 5.582ms 6.252ms +12.0%
10,000 rows/collection | source indexes: manual | synced writes — geomean 0.92×, cold 0.88×
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.095ms 0.079ms -17.3% 0.133ms 0.107ms -19.7% 3.542ms 1.751ms -50.6%
list: newest 50 open 1.040ms 0.979ms -5.8% 1.179ms 1.566ms +32.9% 1.831ms 1.741ms -4.9%
list + author 0.115ms 0.105ms -8.8% 0.162ms 0.136ms -16.3% 3.007ms 3.459ms +15.0%
list + comment count 0.231ms 0.222ms -3.8% 0.311ms 0.261ms -16.2% 4.058ms 3.896ms -4.0%
list + 3 recent comments 0.153ms 0.145ms -5.4% 0.182ms 0.180ms -1.1% 5.499ms 4.958ms -9.8%
issue detail + comments 0.116ms 0.107ms -7.7% 0.213ms 0.135ms -36.7% 0.672ms 0.672ms +0.0%
10,000 rows/collection | source indexes: manual | optimistic writes — geomean 0.95×, cold 0.68×, 1 change(s)
Query Base median PR median Δ median Base p95 PR p95 Δ p95 Base cold PR cold Δ cold
list: newest 50 open 0.107ms 0.102ms -5.4% 0.185ms 0.171ms -7.4% 1.706ms 1.785ms +4.6%
list: newest 50 open 0.089ms 0.078ms -12.9% 0.173ms 0.109ms -37.0% 3.871ms 1.602ms -58.6%
list + author 0.131ms 0.126ms -3.7% 0.205ms 0.223ms +8.9% 4.396ms 3.279ms -25.4%
list + comment count 0.259ms 0.245ms -5.4% 0.542ms 0.329ms -39.3% 3.495ms 3.446ms -1.4%
list + 3 recent comments 0.138ms 0.134ms -2.6% 0.210ms 0.213ms +1.5% 15.933ms 4.483ms -71.9% 🟢
issue detail + comments 0.121ms 0.121ms -0.5% 0.149ms 0.150ms +0.6% 0.612ms 0.652ms +6.6%

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.

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 238 kB

ℹ️ View Unchanged
Filename Size
packages/db/dist/esm/client.js 5.49 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.32 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.9 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/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.19 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/index.js 7.72 kB
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.7 kB
packages/db/dist/esm/query/compiler/joins.js 3.42 kB
packages/db/dist/esm/query/compiler/lazy-targets.js 1.11 kB
packages/db/dist/esm/query/compiler/order-by.js 2.8 kB
packages/db/dist/esm/query/compiler/parent-routes.js 319 B
packages/db/dist/esm/query/compiler/query-equivalence.js 568 B
packages/db/dist/esm/query/compiler/route-metadata.js 1.24 kB
packages/db/dist/esm/query/compiler/select.js 1.5 kB
packages/db/dist/esm/query/effect.js 5.79 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-config-builder.js 8.52 kB
packages/db/dist/esm/query/live/collection-registry.js 264 B
packages/db/dist/esm/query/live/collection-subscriber.js 2.68 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.52 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 626 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/live-query-internals.js 282 B
packages/react-db/dist/esm/source-id-bindings.js 339 B
packages/react-db/dist/esm/useLiveInfiniteQuery.js 1.46 kB
packages/react-db/dist/esm/useLiveQuery.js 3.04 kB
packages/react-db/dist/esm/useLiveQueryEffect.js 504 B
packages/react-db/dist/esm/useLiveSuspenseQuery.js 1.36 kB
packages/react-db/dist/esm/usePacedMutations.js 429 B

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-db

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

@tanstack/browser-db-sqlite-persistence

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

@tanstack/capacitor-db-sqlite-persistence

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

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

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

@tanstack/convex-db-collection

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

@tanstack/db

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

@tanstack/db-ivm

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

@tanstack/db-sqlite-persistence-core

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

@tanstack/electric-db-collection

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

@tanstack/electron-db-sqlite-persistence

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

@tanstack/expo-db-sqlite-persistence

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

@tanstack/node-db-sqlite-persistence

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

@tanstack/offline-transactions

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

@tanstack/powersync-db-collection

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

@tanstack/preact-db

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

@tanstack/query-db-collection

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

@tanstack/react-db

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

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

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

@tanstack/react-router-with-db

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

@tanstack/rxdb-db-collection

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

@tanstack/solid-db

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

@tanstack/svelte-db

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

@tanstack/tauri-db-sqlite-persistence

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

@tanstack/trailbase-db-collection

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

@tanstack/vue-db

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

commit: ea769ec

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