Origin: code review of PR #54, which added MIGRATION_11_12 — the first migration authored with both endpoint schemas exported (11.json + 12.json), and still no test runs it.
Problem
CLAUDE.md states: "Room schemas are exported to app/schemas and validated by migration tests — commit schema changes." That sentence is currently aspirational repo-wide:
No androidx.room:room-testing dependency exists; MigrationTestHelper appears only in comments (app/build.gradle.kts:140, LibreMailDatabaseTest.kt:25-27 "so future migrations can be tested").
LibreMailDatabaseTest builds fresh in-memory v12 databases — the migration DDL is never executed by any test.
DatabaseModule registers no destructive fallback (deliberately — dropping tables would lose stored secrets), so a drift between a migration and the entity/schema expectation crashes upgrading users with IllegalStateException("Migration didn't properly handle: folders") at first DB open, and nothing in CI would have caught it.
Suggested fix
Add androidx.room:room-testing and a MigrationTest (androidTest) using MigrationTestHelper.
Start with 11→12 (both schemas exported): create at v11, insert a folder row, runMigrationsAndValidate(12), assert specialUse defaults to 0 and data survives.
Replay the whole exported chain (7→12) in one test so every future migration is covered automatically, and each new migration only needs the schema commit.
Migrations 1→2 … 10→11 predate exported schemas and are a pre-existing gap; the chain test covers everything from v7 on.
Origin: code review of PR #54, which added `MIGRATION_11_12` — the first migration authored with both endpoint schemas exported (11.json + 12.json), and still no test runs it.
## Problem
CLAUDE.md states: "Room schemas are exported to `app/schemas` and validated by migration tests — commit schema changes." That sentence is currently aspirational repo-wide:
- No `androidx.room:room-testing` dependency exists; `MigrationTestHelper` appears only in comments (`app/build.gradle.kts:140`, `LibreMailDatabaseTest.kt:25-27` "so **future** migrations can be tested").
- `LibreMailDatabaseTest` builds fresh in-memory v12 databases — the migration DDL is never executed by any test.
- `DatabaseModule` registers no destructive fallback (deliberately — dropping tables would lose stored secrets), so a drift between a migration and the entity/schema expectation crashes upgrading users with `IllegalStateException("Migration didn't properly handle: folders")` at first DB open, and nothing in CI would have caught it.
## Suggested fix
1. Add `androidx.room:room-testing` and a `MigrationTest` (androidTest) using `MigrationTestHelper`.
2. Start with 11→12 (both schemas exported): create at v11, insert a folder row, `runMigrationsAndValidate(12)`, assert `specialUse` defaults to 0 and data survives.
3. Replay the whole exported chain (7→12) in one test so every future migration is covered automatically, and each new migration only needs the schema commit.
Migrations 1→2 … 10→11 predate exported schemas and are a pre-existing gap; the chain test covers everything from v7 on.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Origin: code review of PR #54, which added
MIGRATION_11_12— the first migration authored with both endpoint schemas exported (11.json + 12.json), and still no test runs it.Problem
CLAUDE.md states: "Room schemas are exported to
app/schemasand validated by migration tests — commit schema changes." That sentence is currently aspirational repo-wide:androidx.room:room-testingdependency exists;MigrationTestHelperappears only in comments (app/build.gradle.kts:140,LibreMailDatabaseTest.kt:25-27"so future migrations can be tested").LibreMailDatabaseTestbuilds fresh in-memory v12 databases — the migration DDL is never executed by any test.DatabaseModuleregisters no destructive fallback (deliberately — dropping tables would lose stored secrets), so a drift between a migration and the entity/schema expectation crashes upgrading users withIllegalStateException("Migration didn't properly handle: folders")at first DB open, and nothing in CI would have caught it.Suggested fix
androidx.room:room-testingand aMigrationTest(androidTest) usingMigrationTestHelper.runMigrationsAndValidate(12), assertspecialUsedefaults to 0 and data survives.Migrations 1→2 … 10→11 predate exported schemas and are a pre-existing gap; the chain test covers everything from v7 on.