fix(local): repair bigint columns left in SQLite's integer storage class - #1823
Merged
Conversation
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| 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 |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | c216c7c | Aug 28 2026, 09:22 AM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_atrecords 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 everybigintcolumn 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, andformat:checkare clean. The pre-existing SIGKILL-recovery failures inapps/local/src/dbreproduce identically on main.