Skip to content

fix(desktop): make database migrations atomic - #1567

Open
okker24 wants to merge 1 commit into
AChep:masterfrom
okker24:codex/atomic-desktop-migrations
Open

fix(desktop): make database migrations atomic#1567
okker24 wants to merge 1 commit into
AChep:masterfrom
okker24:codex/atomic-desktop-migrations

Conversation

@okker24

@okker24 okker24 commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • run desktop schema creation/migration and PRAGMA user_version in one SQLDelight transaction
  • close the driver if schema setup fails
  • add a regression test that simulates an interrupted migration and verifies that retry succeeds

Why

SQLite DDL can persist before user_version is updated if the process is interrupted. On the next launch, the migration is replayed and can fail with errors such as table ... already exists. Keeping both steps atomic makes the failed attempt roll back cleanly.

Test

  • ./gradlew :common:desktopTest --tests com.artemchep.keyguard.core.store.DatabaseSqlManagerInFileJvmTest --no-daemon --offline --no-watch-fs -Pbuildkonfig.flavor=release

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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