feat(startup): replace legacy migration with a backup gate, drop hive - #2559
Conversation
|
@claude review this please |
This comment was marked as resolved.
This comment was marked as resolved.
c47d087 to
fef0a38
Compare
|
@wired-pasteque can you try the legacy apk https://github.com/SatoshiPortal/bullbitcoin-mobile/actions/runs/30940542068 migration to the current branch https://github.com/SatoshiPortal/bullbitcoin-mobile/actions/runs/30941630233 ? |
fef0a38 to
dc90d5e
Compare
|
@ethicnology, tested on my side - did the full loop, recovery included - everything is working as expected: Installed the legacy APK, set up my wallet, then installed the new build over the top. The notice screen appeared as expected with the steps on what to do (see the screenshot), legacy seeds line in Settings still showed the seed at that point. After reinstalling the app and recovering - balance still correct, nothing lost, and the legacy seeds line in Settings is now gone. Fresh and already-migrated installs start normally with no gate. Working as expected on my end.
|
|
Do you ACK the concept @i5hi @BullishNode @thibistaken ? Getting rid of the unmaintained dependency |
|
conceptACK |
dc90d5e to
c8abf87
Compare
Conflicts resolved: - legacy_seed_view_screen.dart: deleted. This branch replaces the feature with app_startup's legacy backup screen, which already blocks capture through the PrivacyScreen mixin and keeps the words out of the semantics tree, so develop's screen-capture fix (1dd4aec) is preserved in the new screen rather than lost with the old one. - settings_cubit.dart, settings_locator.dart and settings_cubit_test.dart: the union of both sides' removals — no GetOldSeedsUsecase (dropped here along with the hive migration path) and no RevokeArkUsecase (dropped on develop along with the Ark feature). toggleDevMode keeps develop's signature without the WalletBloc parameter, and the cubit keeps develop's payjoin-policy wiring. - 13 .arb files: resolved as a key-level three-way merge, so both sides' additions are kept and both sides' deletions applied. arkAboutDustValue and arkSendConfirmMessage (removed with Ark on develop) and legacySeedViewNoSeedsMessage and bitcoinSettingsLegacySeedsTitle (removed with the legacy seed view here) are all gone.
updateSenderSessionState came in unformatted with the payjoin package (a568d1a), so `make format-check` — and therefore the CI checks job — fails on every branch that carries develop. Formatting only, no behaviour change; cherry-pick it onto develop if you prefer to fix it at the source.

hivewas only kept alive by the legacy storage migrations: the v0.1–v0.4 → v5chain (
004_legacy+005_hive_to_sqlite) and thelegacy_seed_viewrecoveryfeature. Those paths serve BULL builds from 2023–2024 (Android only); the app is
at v6.13.
Simply deleting the migration would strand any user still on those builds: the
app would start empty with no guidance.
What changes
Pre-v5 installs are now gated behind a backup screen instead of being migrated
(commit 1):
CheckLegacyInstallUsecasedetects the legacyversionmarker in securestorage (Android only — other platforms never shipped a pre-v5 build, and the
guard avoids the iOS pre-first-unlock keychain error).
GetLegacySeedsUsecaseenumerates legacy seeds without Hive: the old appalways stored the seed material itself (keyed by fingerprint) in secure
storage; Hive only held the wallet index.
LegacyBackupScreenblocks startup: it shows each recovery phrase (and anynon-empty passphrases — omitting them would strand funds), makes the user
confirm they wrote everything down, then instructs them to delete and
reinstall the app and recover. If the marker says legacy but no seed is
readable, it points to support instead of suggesting a delete.
next two.
Then the legacy path is deleted (commits 2–3): the
legacy_seed_viewfeature, the
004_legacy+005_hive_to_sqlitemigrations,RequiresMigrationUsecase, all DI wiring, and thehivedependency itself(−3 700 lines).
Security notes (key material — please review carefully)
rules: the bloc state carries no seed (
legacyBackupRequiredis a plainmarker); the widget reads the seeds internally and never returns them;
no_screenshotis enabled while shown; the words and passphrases are excludedfrom the semantics/accessibility tree; nothing is logged.
is why the flow instructs a reinstall rather than an in-app reset.
What deliberately does NOT change
pre-v5 version marker.
hiveleaves the lockfile entirely; nothing else depended on it.schema_*_to_*.dart).legacy_seed_viewwas never in the FEATURES.md graph, so no graph update isneeded.
Commit reading order
feat(startup): gate legacy installs behind a seed-backup screen— thebehaviour change: detection, seed enumeration, sealed screen, l10n, tests.
refactor(settings): drop the legacy_seed_view feature— feature + settingswiring + dead l10n keys.
refactor(storage): drop the legacy v4/v5 hive migration path— migrations,DI wiring,
hivedependency.Test plan
Automated (in this PR):
make analyze— no issues (matches CI:--fatal-warnings --fatal-infos)make unit-test— all green, including 10 new tests:CheckLegacyInstallUsecase(marker prefixes, non-Android guard, currentversion) and
GetLegacySeedsUsecase(valid seed parsing, passphrasefiltering, non-seed entries skipped, empty store)
fvm flutter pub get --enforce-lockfileresolves withouthiveManual QA:
gate appears, shows the recovery phrase(s) + passphrase(s), screenshots are
blocked, and the confirm checkbox reveals the reinstall instructions