Skip to content

fix(local): repair bigint columns left in SQLite's integer storage class - #1823

Merged
RhysSullivan merged 1 commit into
mainfrom
issue-1771
Aug 28, 2026
Merged

fix(local): repair bigint columns left in SQLite's integer storage class#1823
RhysSullivan merged 1 commit into
mainfrom
issue-1771

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Fixes #1771

A desktop install lost every saved integration from the MCP gateway at once. Restarting did not bring them back. The credentials were never deleted: the gateway could not read the table they live in, so it served an empty tool list.

connection.expires_at records when an OAuth access token expires. It used to be a plain number and now holds the value's digits, because a millisecond timestamp is larger than a 32-bit integer. SQLite does not rewrite existing rows when a column's declared type changes, so a connection saved by an older build still held the old form. Reading it back failed, and the failure happened while mapping the row — so it failed the whole query, not that one field. One stale row hid every integration.

The diagnostics show the same throw 647 times, always on the epoch-millis value.

The fix

A boot-time data migration converts those values to the current form. It is registered first in the local and self-host registries, so it runs before anything reads the affected tables, and the integrations are back on the first restart after upgrading.

It is deliberately narrow. It touches only columns the schema declares bigint, and within them only values whose SQLite storage class is numeric — the shapes the reader cannot handle. Values already in the current form, and the text form the v1 to v2 migration writes, are left exactly as they are. It runs once, inside a transaction, and is a no-op on a second run.

The column list is derived from the schema rather than hand-written, so a column added later cannot be missed.

Tests

  • packages/core/sdk/src/sqlite-bigint-storage-class-migration.test.ts — plants the legacy value against the real SQLite bring-up and asserts the read throws, then that the migration repairs it, leaves healthy and null rows alone, is idempotent, and covers every bigint column the schema declares.
  • apps/local/src/db/legacy-bigint-boot.test.ts — the wiring: a database file with a legacy row is unreadable, the local registry heals it, and it stays readable across a reboot.

Removing the registry entry fails the boot tests with the exact error from the report.

typecheck, lint, and format:check are clean. The pre-existing SIGKILL-recovery failures in apps/local/src/db reproduce identically on main.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing c216c7c Commit Preview URL

Branch Preview URL
Aug 28 2026, 09:21 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud c216c7c Aug 28 2026, 09:22 AM

@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1823

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1823

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1823

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1823

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1823

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1823

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1823

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1823

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1823

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1823

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1823

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1823

executor

npm i https://pkg.pr.new/executor@1823

commit: c216c7c

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 28, 2026 18:28
@RhysSullivan
RhysSullivan merged commit d74865f into main Aug 28, 2026
44 checks passed
@RhysSullivan RhysSullivan mentioned this pull request Aug 28, 2026
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.

[desktop] 15+ saved integrations are missing from the Executor MCP gateway

1 participant