Skip to content

Fix crash re: the wallet picker after creating a new Ethereum wallet - #1483

Draft
sneurlax wants to merge 2 commits into
stagingfrom
fix/eth-add-token-new-wallet
Draft

sneurlax wants to merge 2 commits into
stagingfrom
fix/eth-add-token-new-wallet

Conversation

@sneurlax

@sneurlax sneurlax commented Nov 1, 2026

Copy link
Copy Markdown
Member

In the add-token flow, choosing "Add new Ethereum wallet", creating it and verifying the recovery phrase returns to the wallet picker, which shows a red "Wallet with id ... not found" error from eth_wallet_radio.dart:37. Going back and pressing Next again works.

Cause

Wallet.create writes the new wallet's info to Isar before pWallets.addWallet runs at the end of the verify step (verify_recovery_phrase_view.dart:295). SelectWalletForTokenView builds its list from pAllWalletsInfo, so it rebuilt with the new wallet id while that wallet wasn't in pWallets yet, and EthWalletRadio threw through Wallets.getWallet.

Change

The picker skips wallet ids that aren't registered in pWallets yet, and watches newEthWalletTriggerTempUntilHiveCompletelyDeleted, which the verify step already toggles right after addWallet, so it rebuilds once the wallet is registered.

Tested

  • Full flutter test: 687 passed, 8 skipped, 0 failed (no existing test covers this view).
  • Linux debug build, same flow on both builds (new Stack, add wallet, USD Coin, Add new Ethereum wallet, create, verify): the unfixed build shows the error; the fixed build lists the new wallet, and continuing reaches Edit Tokens with USD Coin checked.

Not done

select_wallet_for_sol_token_view.dart has the same pattern, but nothing toggles its trigger after addWallet, so filtering there alone could hide a new Solana wallet until the next rebuild. It needs the trigger toggled in the verify step as well; left for a follow-up with its own test.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.62%. Comparing base (ad1efd5) to head (44c7bc0).
⚠️ Report is 27 commits behind head on staging.

Files with missing lines Patch % Lines
...add_wallet_views/select_wallet_for_token_view.dart 0.00% 32 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1483      +/-   ##
===========================================
+ Coverage    10.74%   11.62%   +0.87%     
===========================================
  Files         1132     1134       +2     
  Lines       113993   114195     +202     
===========================================
+ Hits         12254    13272    +1018     
+ Misses      101739   100923     -816     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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