Skip to content

fix: restore type assertions a merge commit's lint fix removed - #2125

Merged
KyleAMathews merged 1 commit into
mainfrom
fix-restore-lint-fixed-files
Oct 13, 2026
Merged

KyleAMathews merged 1 commit into
mainfrom
fix-restore-lint-fixed-files

Conversation

@KyleAMathews

@KyleAMathews KyleAMathews commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

🎯 Changes

main fails CI after #2112. This PR fixes it.

  • The trailbase-db-collection build fails: src/trailbase.ts:267 and :290, TRecord | undefined is not assignable to TRecord.
  • The query-db-collection lint fails.

Cause

I merged main into the #2112 branch before #2112 merged. The pre-commit hook ran eslint --fix on the merge commit, but that worktree had no built @tanstack/db. TrailBase and query-db read types from db/dist. Without these types, eslint removed non-null assertions, two casts and two eslint-disable comments as unnecessary. CI builds the packages first, and there these changes are necessary. I merged #2112 before CI ran on that merge commit.

Fix

This PR restores the four files to their versions before #2112:

  • packages/trailbase-db-collection/src/trailbase.ts
  • packages/query-db-collection/src/query.ts
  • packages/query-db-collection/tests/query.test.ts
  • packages/electric-db-collection/tests/electric-recovery-oracle.test.ts

With @tanstack/db built, trailbase-db-collection type-checks, and eslint reports no errors in these files.

✅ Checklist

  • I have tested this code locally with pnpm test.

🚀 Release Impact

  • This change does not affect published code. No changeset is necessary.

This pull request and its description were written by Isaac.

Summary by CodeRabbit

  • Chores
    • Updated TypeScript checks and lint annotations in internal database and query handling. These changes do not alter runtime behavior or public APIs.
  • Tests
    • Updated test typing to reflect values already assumed to be present. Test behavior and coverage remain unchanged. No user-visible features or behavior changes are included in this release.

The pre-commit `eslint --fix` on #2112's merge-from-main commit ran without
a built `@tanstack/db`, so it lost the types that trailbase and query-db
read from `dist` and removed non-null assertions, casts and two
eslint-disable comments as unnecessary. CI builds first, where they are
needed: the trailbase build and the query-db lint fail on main. Restore the
four files to their versions before #2112.

Co-authored-by: Isaac <no-reply@databricks.com>
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f4b1bff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 553446bc-6d73-4032-b338-e8689c4fa779
📥 Commits

Reviewing files that changed from the base of the PR and between bc6f30e and f4b1bff.

📒 Files selected for processing (4)
  • packages/electric-db-collection/tests/electric-recovery-oracle.test.ts
  • packages/query-db-collection/src/query.ts
  • packages/query-db-collection/tests/query.test.ts
  • packages/trailbase-db-collection/src/trailbase.ts

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

📝 Walkthrough

This change adds TypeScript assertions to test helpers and Trailbase record accesses, adds eslint suppression comments before required-parameter checks, and adds a non-null assertion in a query cache test. The changes do not alter runtime behavior.

Changes: Typing and lint annotations

Layer / File(s) Summary
Type and lint annotations
packages/electric-db-collection/tests/electric-recovery-oracle.test.ts, packages/query-db-collection/src/query.ts, packages/query-db-collection/tests/query.test.ts, packages/trailbase-db-collection/src/trailbase.ts
Test helpers and Trailbase page record accesses gain type assertions. Required-parameter checks gain eslint suppression comments, and the query cache test asserts that subsetQuery is non-null.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f4b1b

The changes restore type and lint annotations without altering runtime behavior. The inspected invariants support them, and no actionable merge-blocking risk was found.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. 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 clearly and concisely describes the main change: restoring type assertions removed by a merge commit's lint fix.
Description check Passed The description includes the required Changes, Checklist, and Release Impact sections. It explains the failure, cause, fix, test status, and release impact.
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.
  • Fix all pre-merge checks with AI
✨ 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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 13, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-db

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

@tanstack/browser-db-sqlite-persistence

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

@tanstack/capacitor-db-sqlite-persistence

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

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

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

@tanstack/db

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

@tanstack/db-ivm

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

@tanstack/db-sqlite-persistence-core

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

@tanstack/electric-db-collection

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

@tanstack/electron-db-sqlite-persistence

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

@tanstack/expo-db-sqlite-persistence

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

@tanstack/node-db-sqlite-persistence

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

@tanstack/offline-transactions

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

@tanstack/powersync-db-collection

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

@tanstack/query-db-collection

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

@tanstack/react-db

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

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

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

@tanstack/react-router-with-db

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

@tanstack/rxdb-db-collection

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

@tanstack/solid-db

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

@tanstack/svelte-db

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

@tanstack/tauri-db-sqlite-persistence

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

@tanstack/trailbase-db-collection

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

@tanstack/vue-db

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

commit: f4b1bff

@github-actions

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 215 kB

ℹ️ View Unchanged
Filename Size
packages/db/dist/esm/client.js 4.24 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.74 kB
packages/db/dist/esm/collection/changes.js 2.99 kB
packages/db/dist/esm/collection/cleanup-queue.js 901 B
packages/db/dist/esm/collection/config-errors.js 547 B
packages/db/dist/esm/collection/events.js 481 B
packages/db/dist/esm/collection/index.js 5.24 kB
packages/db/dist/esm/collection/indexes.js 2.3 kB
packages/db/dist/esm/collection/lifecycle.js 2.94 kB
packages/db/dist/esm/collection/mutations.js 2.99 kB
packages/db/dist/esm/collection/state.js 7.13 kB
packages/db/dist/esm/collection/subscription.js 8.7 kB
packages/db/dist/esm/collection/sync.js 5.32 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 6.49 kB
packages/db/dist/esm/event-emitter.js 1.06 kB
packages/db/dist/esm/index.js 4.49 kB
packages/db/dist/esm/indexed-db-wrapper.js 1.91 kB
packages/db/dist/esm/indexed-db.js 3.7 kB
packages/db/dist/esm/indexes/auto-index.js 929 B
packages/db/dist/esm/indexes/base-index.js 1.52 kB
packages/db/dist/esm/indexes/basic-index.js 2.02 kB
packages/db/dist/esm/indexes/btree-index.js 2.34 kB
packages/db/dist/esm/indexes/index-registry.js 916 B
packages/db/dist/esm/indexes/reverse-index.js 1 kB
packages/db/dist/esm/live-query-adapter.js 338 B
packages/db/dist/esm/live-query-observer.js 4.81 kB
packages/db/dist/esm/live-query-options.js 1.4 kB
packages/db/dist/esm/live-query-window-controller.js 4.27 kB
packages/db/dist/esm/local-only.js 1.08 kB
packages/db/dist/esm/local-storage.js 3.93 kB
packages/db/dist/esm/optimistic-action.js 359 B
packages/db/dist/esm/paced-mutations.js 1.11 kB
packages/db/dist/esm/persisted-readiness.js 195 B
packages/db/dist/esm/proxy.js 3.51 kB
packages/db/dist/esm/query/builder/clone-query.js 849 B
packages/db/dist/esm/query/builder/functions.js 1.54 kB
packages/db/dist/esm/query/builder/index.js 7.49 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/group-by.js 4.48 kB
packages/db/dist/esm/query/compiler/index.js 10.1 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.09 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.28 kB
packages/db/dist/esm/query/equality-conjunct.js 486 B
packages/db/dist/esm/query/equality-value-identity.js 735 B
packages/db/dist/esm/query/expression-helpers.js 1.61 kB
packages/db/dist/esm/query/ir-stable-identity.js 4.2 kB
packages/db/dist/esm/query/ir.js 2.2 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 6.75 kB
packages/db/dist/esm/query/live/collection-registry.js 264 B
packages/db/dist/esm/query/live/collection-subscriber.js 2.2 kB
packages/db/dist/esm/query/live/graph-scheduler.js 305 B
packages/db/dist/esm/query/live/internal.js 145 B
packages/db/dist/esm/query/live/materialized-pipeline.js 2.39 kB
packages/db/dist/esm/query/live/ordered-source-loader.js 4.49 kB
packages/db/dist/esm/query/live/subset-demand-controller.js 1.73 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 4.13 kB
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.6 kB
packages/db/dist/esm/strategies/commit-completion.js 156 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.62 kB
packages/db/dist/esm/utils.js 1.57 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 174 B
packages/db/dist/esm/utils/comparison.js 1.7 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.43 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 413 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 746 B
packages/react-db/dist/esm/useLiveInfiniteQuery.js 2.15 kB
packages/react-db/dist/esm/useLiveQuery.js 3.34 kB
packages/react-db/dist/esm/useLiveQueryEffect.js 504 B
packages/react-db/dist/esm/useLiveSuspenseQuery.js 1.33 kB
packages/react-db/dist/esm/usePacedMutations.js 401 B

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

@KyleAMathews
KyleAMathews merged commit b112d88 into main Oct 13, 2026
25 checks passed
@KyleAMathews
KyleAMathews deleted the fix-restore-lint-fixed-files branch October 13, 2026 13:12
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