docs(#943): the first correction gave the wrong reason, revise it

4b8f5731 corrected the plan's downgrade claim but explained it with a drift
version check that does not exist. drift compares the stored user_version
against schemaVersion for inequality and routes a downgrade into onUpgrade;
the pre-#917 build simply had no migration getter, so it got the default that
throws.

The conclusion is unchanged and firmer: every shipped build lacks that
strategy, so nothing done now can let one open a schema-2 file.

Also points at the measurements and the per-decision recommendations now on
the issue, and at the test that pins the behaviour.

Task: meshcore-open-3e1
Agent Mail: TealGlen

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix/943-952-storage-migration
diffwireauto 1 month ago
parent 2076474124
commit 7e4865eea4

@ -111,9 +111,11 @@ One-time migration of the worst key (5.38 MiB, 9,230 messages), measured with a
1. **The blob is never deleted**, not even on a verified match. This plan said "retained until per-key readback matches"; the implementation keeps it after the match too. Rows become the read and write path and the blob is left untouched, so the database temporarily holds both copies. Reclaiming that space is a separate owner-gated step, because the moment that delete runs is the moment a mistake stops being recoverable.
> **Correction, 2026-10-21 (#943).** This section originally added that a downgrade to an older build "still finds its history where it looks for it". That is true of the **data** and false in **practice**, and the owner hit it: drift refuses to open a database whose `user_version` is newer than the binary's `schemaVersion`, so a pre-#917 build cannot open a migrated database at all. It never gets as far as the blobs it would have read.
> **Correction, 2026-10-21 (#943), revised 2026-10-22.** This section originally added that a downgrade to an older build "still finds its history where it looks for it". That is true of the **data** and false in **practice**, and the owner hit it: a pre-#917 build cannot open a migrated database at all, so it never gets as far as the blobs it would have read.
>
> The consequence is a release one, not a desktop one: **once a user launches a schema-2 build they cannot go back to an earlier release.** A Play rollback or a halted staged rollout does not help anyone who already launched it, and the real fallback is an older build *plus* a pre-migration database copy, which loses everything received since. #943 carries the decisions (release-note wording, whether to tolerate a newer schema, whether the app should take its own pre-migration copy).
> The first version of this correction gave the wrong reason, namely that drift refuses a newer `user_version`. It does not; there is no such check. drift compares the stored version against `schemaVersion` for *inequality* and routes a downgrade into `onUpgrade` just like an upgrade. The pre-#917 build declared schema 1 and **no `migration` getter**, so it got drift's default `onUpgrade`, which throws. The conclusion stands and is in fact firmer: every already-shipped build lacks that strategy, so no change made now can let one open a schema-2 file.
>
> The consequence is a release one, not a desktop one: **once a user launches a schema-2 build they cannot go back to an earlier release.** A Play rollback or a halted staged rollout does not help anyone who already launched it, and the real fallback is an older build *plus* a pre-migration database copy, which loses everything received since. #943 carries the decisions (release-note wording, whether to tolerate a newer schema, whether the app should take its own pre-migration copy), with measurements and a recommendation per decision in its comments. Behaviour is pinned by `test/storage/schema_downgrade_test.dart`.
2. **One row per message with the per-message JSON in a `payload` column**, rather than a column per field. The migration is then a pure re-key with no field mapping that can silently drop or coerce a value, and the stores reuse their existing encoders verbatim. The trade, stated on the issue before building: message fields are not SQL-queryable. Columns can be added beside the payload later without another data migration.
### Epic C: Integration Testing

Loading…
Cancel
Save

Powered by TurnKey Linux.