feat(migration): implement legacy wallet migration flow#3475
feat(migration): implement legacy wallet migration flow#3475
Conversation
|
Visit the preview URL for this PR (updated for commit 612d9c2): https://walletrc--pull-3475-merge-ysemtthd.web.app (expires Mon, 20 Apr 2026 09:38:29 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
… dialog Add end-to-end legacy wallet migration flow that detects native legacy wallets and guides users through a compatibility dialog to set a valid KDF wallet name and password before migrating. Key changes: - AuthBloc: add AuthLegacyMigrationRequested event with non-critical step isolation so metadata/asset failures don't block login - WalletsRepository: legacy wallet detection, seed decryption, name sanitisation, native-secret extraction, and post-migration cleanup - New PreparedLegacyMigration model and LegacyAppSettingsMigrationService for reading legacy shared-preference data - IguanaWalletsManager: intercept legacy wallet sign-in and present the LegacyMigrationCompatibilityDialog before dispatching migration - SecuritySettings: add LegacyMigrationCleanupPlate for incomplete native cleanup visibility - zHTLC config dialog: expose "recent transactions" sync policy option consumed during migration - Translation strings for all new migration UI copy
Store the user's selected fiat currency in local storage so it survives bloc resets and app restarts. On initialisation the bloc hydrates from storage; on selection it writes through immediately. - Add fiat_default_preference.dart with load/persist helpers - FiatFormBloc: hydrate on construction via new event, write on select - FiatFormState.initial: accept optional pre-selected fiat currency - Resolve selected fiat against the loaded fiat list to avoid stale refs
Move the Android MainActivity from the old com.komodoplatform.atomicdex package to com.gleec.gleecdex to match the updated application ID.
Align the iOS PRODUCT_BUNDLE_IDENTIFIER across Debug, Profile, and Release configurations to the new com.GleecDEX.wallet identifier.
Cover the new migration and fiat-preference features: - LegacyAppSettingsMigrationService parsing and edge cases - FiatDefaultPreference load/persist round-trip - Legacy native wallet migration integration scenarios - LegacyMigrationCleanupPlate widget rendering - LegacyMigrationCompatibilityDialog validation and flow
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- move legacy migration handling into the parent app auth and wallet manager flows, including already-migrated wallet routing - finalize restore and migration metadata in the background so login can complete without blocking on non-critical steps
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b9f7b02d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
P1: Make legacy linkage metadata write a hard requirement by removing the try-catch that silently swallowed setMigratedLegacySource failures. Failures now propagate to the outer catch, aborting the migration and preventing the user from being logged into a wallet with no source-link metadata (which would allow duplicate migrations). P2: Fix cleanup status to reflect the actual outcome regardless of wallet type. Previously, non-native legacy wallets always got 'complete' status even on partial cleanup failure, suppressing follow-up handling.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4146cff057
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ility dargon2_flutter's web plugin uses JS interop APIs incompatible with Flutter WASM builds. Replaced with pointycastle's pure-Dart Argon2 implementation which works on all platforms. Removes 7 transitive dargon2 packages from the dependency tree.
…llback P2: Allow metadata-enriched watcher updates through after optimistic login. The early return in _onAuthChanged was suppressing all same-wallet updates, including post-finalizer metadata changes (cleanup status, activated coins). Now only suppresses when incoming metadata has no new or changed values vs the current optimistic state. P1: Roll back SDK session when pre-login migration metadata write fails. After auth.register succeeds but linkage metadata write throws, sign out the freshly registered user before emitting error state to avoid leaving SDK auth and UI auth out of sync.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f7fa61155
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| required Future<void> Function() action, | ||
| }) async { | ||
| try { | ||
| await action().timeout(_postLoginStepTimeout); |
There was a problem hiding this comment.
Avoid timeout wrappers that leave post-login tasks running
_runNonCriticalRestoreStep uses action().timeout(...), but Future.timeout does not cancel the underlying action. In _onLegacyMigration, if legacy cleanup takes more than 5 seconds, the timeout path persists cleanupStatus as incomplete, while the cleanup call can still finish successfully afterward. This creates incorrect persisted metadata (and warning UI) for wallets that were actually cleaned up, especially on slower devices or busy I/O conditions.
Useful? React with 👍 / 👎.
Replace timeout-wrapped cleanup-then-persist sequence in legacy migration with inline try-catch so the persisted cleanup status always reflects the actual outcome instead of racing against a 5-second Future.timeout that cannot cancel the underlying I/O. Roll SDK submodule to af9c5b7 which hardens the RPC readiness probe against transient transport errors and adds platform guards to readWalletSecrets.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 612d9c2f0a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!cleanupOutcome.isComplete && !cleanupOutcome.sourceRemoved) { | ||
| throw AuthException( |
There was a problem hiding this comment.
Fail native wallet deletion on any partial cleanup
The native-legacy delete path only throws when cleanup is partial and metadata was not removed. If deleteLegacyWalletData returns partial with sourceRemoved == true (for example, secure-storage keys fail to delete after metadata removal), this method returns success and removes the wallet from cache, leaving sensitive legacy residue with no user-visible failure or retry path.
Useful? React with 👍 / 👎.
Summary
End-to-end legacy wallet migration that detects native legacy wallets and guides users through a compatibility dialog before migrating them to KDF-managed wallets.
com.gleec.gleecdex, iOS bundle identifier updated tocom.GleecDEX.walletCommits
feat(migration): implement legacy wallet migration with compatibility dialogfeat(fiat): persist default fiat currency preference across sessionschore(android): migrate MainActivity to com.gleec.gleecdex packagechore(ios): update bundle identifier to com.GleecDEX.wallettest: add unit tests for legacy migration and fiat preferenceKey components
AuthLegacyMigrationRequestedevent with_onLegacyMigrationhandler in AuthBlocLegacyMigrationCompatibilityDialogfor name/password entry before migrationLegacyMigrationCleanupPlatein security settings for incomplete cleanup visibilityLegacyAppSettingsMigrationServicefor reading legacy shared-preference dataPreparedLegacyMigrationmodel carrying migration parametersFiatDefaultPreferenceload/persist helpers withBaseStorageTest plan
test_units/)