Uh oh!
There was an error while loading. Please reload this page.
fix: preserve operational state across schema upgrades - #2361
Merged
Conversation
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 freeto 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.
Summary
runtime.sqlitereset so existing forward migrations preserve sessions, messages, and other operational state across upgradesCloses#2357.
Verification
npm run format:checknpm run lintnpm run build:workspace-deps --workspace @maka/desktopnpm run build:main --workspace @maka/desktopnode --test packages/storage/dist/__tests__/operational-state-store.test.js— 8 passednode --test packages/storage/dist/__tests__/sqlite-recovery-concurrency.test.js— 8 consecutive runs passednpm run test:dist --workspace=@maka/storage— 734 passed, 0 failed, 12 skippednpm test— build and all affected tests passed; the command exited 1 on the existingartifact-writer-lockcleanup race (ENOTEMPTY). The same two cleanup failures reproduce on an unmodifiedmainbaseline.Review focus
The preflight intentionally lives in the storage owner rather than Desktop. This protects CLI, headless, runtime-host, and Desktop callers and prevents an unsupported later scope from being discovered only after an earlier scope has already migrated.
The preflight sets only the connection-local
busy_timeoutbefore reading schema authorities. Persistent WAL configuration and migrations still happen only after compatibility succeeds, so a rejected database remains unchanged.Downgrade read/write compatibility is intentionally not introduced here. A follow-up will define an explicit global minimum-reader epoch and expand/contract migration rules from a new safe baseline; this PR only stops data loss and restores the existing forward-migration path.