Skip to content

fix: don't prevent users from removing account that are from account snap accounts#40404

Merged
shane-t merged 3 commits intomainfrom
shane-t/re-enable-remove-snap-accounts
Mar 5, 2026
Merged

fix: don't prevent users from removing account that are from account snap accounts#40404
shane-t merged 3 commits intomainfrom
shane-t/re-enable-remove-snap-accounts

Conversation

@shane-t
Copy link
Member

@shane-t shane-t commented Feb 25, 2026

Description

Institutional snap users need to be able to remove the accounts, so that they can (for example) update their tokens

Changelog

CHANGELOG entry: Allow users to remove snap accounts if they are from a snap account wallet

Related issues

N/A

Manual testing steps

  1. Import a Cubist account
  2. Visit the account details page
  3. Observe that it is now removable

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Expands when account removal UI is exposed; incorrect wallet-type detection could allow unintended removals or confuse users, though the change is small and localized.

Overview
Allows the Remove account section to appear for Snap wallet types by changing the removability check in MultichainAccountDetailsPage to only block Entropy wallets.

Updates the page test suite by removing the expectation that Snap wallets cannot be removed, keeping coverage for Entropy (not removable) and Keyring (removable).

Written by Cursor Bugbot for commit ce49af3. This will update automatically on new commits. Configure here.

@shane-t shane-t requested a review from a team as a code owner February 25, 2026 14:24
@shane-t shane-t requested a review from david0xd February 25, 2026 14:24
@metamaskbot metamaskbot added the team-mobile-ux Mobile UX team label Feb 25, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

✨ Files requiring CODEOWNER review ✨

🔑 @MetaMask/accounts-engineers (2 files, +1 -13)
  • 📁 ui/
    • 📁 pages/
      • 📁 multichain-accounts/
        • 📁 multichain-account-details-page/
          • 📄 multichain-account-details-page.test.tsx +0 -10
          • 📄 multichain-account-details-page.tsx +1 -3

@shane-t shane-t force-pushed the shane-t/re-enable-remove-snap-accounts branch from 5354a2a to 8ae89fc Compare February 25, 2026 14:36
@github-actions github-actions bot added size-S and removed size-XS labels Feb 25, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [8ae89fc]
⚡ Performance Benchmarks (1432 ± 106 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account27412270295
total27412270295
Confirm Txconfirm_tx60531760676071
total60531760676071
Bridge User Actionsbridge_load_page20722218240
bridge_load_asset_picker21448244281
bridge_search_token71219733739
total11335811621233
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14321233175210614721644
load1200102014329112371377
domContentLoaded1193100914289012331357
domInteractive2816101182578
firstPaint168741315140212349
backgroundConnect21319337421212243
firstReactRender19134352028
initialActions105113
loadScripts99881112359010351170
setupStore1264151520
numNetworkReqs312292202282
Chrome Browserify Startup Power User HomeuiStartup17261394224613217732013
load11431022163213711371537
domContentLoaded11271016162313111171492
domInteractive3519151213481
firstPaint1707346680225296
backgroundConnect28826161436293312
firstReactRender23164562634
initialActions1012112
loadScripts91980714001319101291
setupStore17881121844
numNetworkReqs61401492558131
Chrome Webpack Startup Standard HomeuiStartup86070213811098861081
load737612111695780887
domContentLoaded731606110794772882
domInteractive2816144222379
firstPaint1125941361131222
backgroundConnect292087113545
firstReactRender18123452030
initialActions106112
loadScripts728604109993770874
setupStore1153641219
numNetworkReqs312291202585
Chrome Webpack Startup Power User HomeuiStartup1257921215617513231581
load75264514231207431040
domContentLoaded74263814121207311033
domInteractive39181663434133
firstPaint1496849593164364
backgroundConnect18213446756188296
firstReactRender24184142529
initialActions103112
loadScripts73963614031187291025
setupStore1365161420
numNetworkReqs68372413671150
Firefox Browserify Startup Standard HomeuiStartup17671505286825717602283
load14801277263219914971684
domContentLoaded14781272263219914971684
domInteractive105381187119126154
firstPaint------
backgroundConnect68303164361158
firstReactRender14122011416
initialActions102112
loadScripts14491253260719414691656
setupStore30810811081643
numNetworkReqs321998202789
Firefox Browserify Startup Power User HomeuiStartup26951986400641828643549
load15221237245624115561963
domContentLoaded15221233245624115561963
domInteractive1133548894111362
firstPaint------
backgroundConnect3221101204274416906
firstReactRender19146281923
initialActions203122
loadScripts14871216241723315131878
setupStore14081039202152542
numNetworkReqs64321863481128
Firefox Webpack Startup Standard HomeuiStartup16971437352422517251972
load14281170303018614551614
domContentLoaded14271165302918614551614
domInteractive116311584156131182
firstPaint------
backgroundConnect64262283665151
firstReactRender16132841725
initialActions103122
loadScripts14011156299918414281588
setupStore178157181445
numNetworkReqs3120100192782
Firefox Webpack Startup Power User HomeuiStartup27602019900076628393664
load15961261714462716552122
domContentLoaded15951260714362716542122
domInteractive14833778175116651
firstPaint------
backgroundConnect3101151299255309900
firstReactRender21156062430
initialActions203122
loadScripts15611233711562415762053
setupStore16481559267152710
numNetworkReqs63322324089143
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2171218219
srpButtonToSrpForm9229394
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1601616
doneButtonToHomeScreen1186411921192
openAccountMenuToAccountListLoaded685160272337861
total829644688038881
Onboarding New WalletcreateWalletToSocialScreen2201219222
srpButtonToPwForm1060106106
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3613738
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList62895698723
total10723811081108
Asset DetailsassetClickToPriceChart4024043
total4024043
Solana Asset DetailsassetClickToPriceChart6126464
total6126464
Import Srp HomeloginToHomeScreen19088919092052
openAccountMenuAfterLogin4224344
homeAfterImportWithNewWallet23402423422372
total42301942524252
Send TransactionsopenSendPageFromHome3914040
selectTokenToSendFormLoaded2002020
reviewTransactionToConfirmationPage8482850850
total9105913915
SwapopenSwapPageFromHome11411119132
fetchAndDisplaySwapQuotes4571445724575
total46811046814694
🌐 Dapp Page Load Benchmarks

Current Commit: 8ae89fc | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±52ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 726ms (±50ms) 🟢 | historical mean value: 732ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 52ms 1.01s 1.32s 1.08s 1.32s
domContentLoaded 726ms 50ms 699ms 993ms 758ms 993ms
firstPaint 76ms 11ms 64ms 172ms 84ms 172ms
firstContentfulPaint 76ms 11ms 64ms 172ms 84ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: -47 Bytes (0%)
  • common: 156 Bytes (0%)

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [acd318c]
⚡ Performance Benchmarks (1394 ± 99 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account28219282314
total28219282314
Confirm Txconfirm_tx60662560906102
total60662560906102
Bridge User Actionsbridge_load_page22918235255
bridge_load_asset_picker23012236244
bridge_search_token71817736739
total11766112081259
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup1394115016469914521566
load118197214539312191341
domContentLoaded117596814479312141334
domInteractive2716115182376
firstPaint161651215164204312
backgroundConnect20518525812207234
firstReactRender18123841924
initialActions106113
loadScripts98677812449210281143
setupStore147153151519
numNetworkReqs312295202286
Chrome Browserify Startup Power User HomeuiStartup2218136512595162420474489
load11571008161814511911507
domContentLoaded11431000160914111691479
domInteractive3518108193789
firstPaint1687846279226332
backgroundConnect50925564318143151470
firstReactRender24155282741
initialActions106112
loadScripts93679513871349571264
setupStore18672112140
numNetworkReqs68301602978138
Chrome Webpack Startup Standard HomeuiStartup87169011671109471085
load740609103296805905
domContentLoaded734606102595802896
domInteractive271695202384
firstPaint1186233965156225
backgroundConnect27175783044
firstReactRender18113861930
initialActions102011
loadScripts731604102495800887
setupStore1265261219
numNetworkReqs312295202590
Chrome Webpack Startup Power User HomeuiStartup1288909252823413311677
load75365115381297371090
domContentLoaded74164415291297261067
domInteractive40191582938130
firstPaint173711138146171407
backgroundConnect18913391493178284
firstReactRender23175652429
initialActions102111
loadScripts73864215151277241057
setupStore1354361521
numNetworkReqs1184025444143213
Firefox Browserify Startup Standard HomeuiStartup16781405251421217042080
load14151162219417714361634
domContentLoaded14131162219417714351633
domInteractive963485089110165
firstPaint------
backgroundConnect61272273256123
firstReactRender14112421417
initialActions103122
loadScripts13851138216017214091562
setupStore178156181636
numNetworkReqs3120101202590
Firefox Browserify Startup Power User HomeuiStartup292621089228101229223892
load17181337740388216382137
domContentLoaded17171331740388216382137
domInteractive14836667139136483
firstPaint------
backgroundConnect34612014153014071005
firstReactRender19147481924
initialActions2047523
loadScripts16811311737088115932096
setupStore14210764184145594
numNetworkReqs73311823791150
Firefox Webpack Startup Standard HomeuiStartup17421433326828417512015
load14681203290725614761631
domContentLoaded14671203290725614751631
domInteractive882822440130139
firstPaint------
backgroundConnect65273193973117
firstReactRender16122831624
initialActions103122
loadScripts14401179287225314481584
setupStore258301411772
numNetworkReqs311996192782
Firefox Webpack Startup Power User HomeuiStartup28031948904976829073722
load15991259751566716802228
domContentLoaded15981259751566716792227
domInteractive177301273224153666
firstPaint------
backgroundConnect3551171821310440950
firstReactRender2215178172229
initialActions203122
loadScripts15621237747466216552207
setupStore1888832237231725
numNetworkReqs73322223783146
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2246231232
srpButtonToSrpForm9019091
confirmSrpToPwForm2102121
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1501616
doneButtonToHomeScreen84629710351333
openAccountMenuToAccountListLoaded70799670327244
total839648189509011
Onboarding New WalletcreateWalletToSocialScreen2234225230
srpButtonToPwForm1051106106
createPwToRecoveryScreen8099
skipBackupToMetricsScreen3603637
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList100934312541437
total139734216411824
Asset DetailsassetClickToPriceChart57187180
total57187180
Solana Asset DetailsassetClickToPriceChart4904949
total4904949
Import Srp HomeloginToHomeScreen196911820732082
openAccountMenuAfterLogin4374655
homeAfterImportWithNewWallet235819825842611
total431117042944571
Send TransactionsopenSendPageFromHome2593539
selectTokenToSendFormLoaded2002020
reviewTransactionToConfirmationPage8525855858
total90219919929
SwapopenSwapPageFromHome1024104107
fetchAndDisplaySwapQuotes46567447234763
total47638148204893
🌐 Dapp Page Load Benchmarks

Current Commit: acd318c | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±36ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±9ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 37ms 1.01s 1.32s 1.06s 1.32s
domContentLoaded 722ms 36ms 702ms 991ms 741ms 991ms
firstPaint 76ms 9ms 56ms 152ms 84ms 152ms
firstContentfulPaint 76ms 9ms 56ms 152ms 84ms 152ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: -47 Bytes (0%)
  • common: 156 Bytes (0%)

@sonarqubecloud
Copy link

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [ce49af3]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2772682856279285
total2772682856279285
Confirm Txconfirm_tx6059603560841860626084
total6059603560841860626084
Bridge User Actionsbridge_load_page20117122823227228
bridge_load_asset_picker19916423628221236
bridge_search_token7047027072707707
total1104107611281811191128
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14291207188111214691618
load1204102415829812441395
domContentLoaded1197101615749712331373
domInteractive281699172575
firstPaint171701275139225341
backgroundConnect21720027013221245
firstReactRender20135382138
initialActions105123
loadScripts99781513689710351177
setupStore1476171626
numNetworkReqs312293192283
Power User HomeuiStartup19981429886286520303135
load11881038203115112231474
domContentLoaded11721029198314712111450
domInteractive3820261293968
firstPaint1988447483268325
backgroundConnect41526330833853371082
firstReactRender24155782541
initialActions107112
loadScripts95882417381429961241
setupStore1665781835
numNetworkReqs68371512376115
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182142212220221
srpButtonToSrpForm91919209192
confirmSrpToPwForm21212202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen16161701617
doneButtonToHomeScreen1042821144126212731441
openAccountMenuToAccountListLoaded72276816762635576217626
total8775862588609088098860
Onboarding New WalletcreateWalletToSocialScreen2202172222221222
srpButtonToPwForm1151051319120131
createPwToRecoveryScreen889099
skipBackupToMetricsScreen35343613636
agreeButtonToOnboardingSuccess16151701617
doneButtonToAssetList942571144336112991443
total1337963185636616881856
Asset DetailsassetClickToPriceChart42384634446
total42384634446
Solana Asset DetailsassetClickToPriceChart49485115051
total49485115051
Import Srp HomeloginToHomeScreen21331970229912722242299
openAccountMenuAfterLogin43394634546
homeAfterImportWithNewWallet22552100254015923102540
total4433432545819244874581
Send TransactionsopenSendPageFromHome301751134051
selectTokenToSendFormLoaded20192322023
reviewTransactionToConfirmationPage8528468585856858
total90589292112917921
SwapopenSwapPageFromHome12010113010129130
fetchAndDisplaySwapQuotes457645674586745774586
total470046914707747074707
🌐 Dapp Page Load Benchmarks

Current Commit: ce49af3 | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±59ms) 🟡 | historical mean value: 1.06s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 756ms (±75ms) 🟢 | historical mean value: 746ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 95ms (±132ms) 🟢 | historical mean value: 86ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 59ms 1.04s 1.42s 1.12s 1.42s
domContentLoaded 756ms 75ms 726ms 1.34s 798ms 1.34s
firstPaint 95ms 132ms 64ms 1.41s 92ms 1.41s
firstContentfulPaint 95ms 132ms 64ms 1.41s 92ms 1.41s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.15 MiB (28.91%)
  • ui: -5.21 KiB (-0.06%)
  • common: -64.64 KiB (-0.57%)

Comment on lines -129 to -137
it('does not render remove account section for Snap wallet type', () => {
mockUseParams.mockReturnValue({
id: 'snap:local:snap-id/0xb552685e3d2790efd64a175b00d51f02cdafee5d',
});

renderComponent();

expect(screen.queryByText(/remove account/iu)).not.toBeInTheDocument();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caveat here is that is should only be true for 3rd party snap. I think this is ok now that we have multichain accounts

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is because e.g. solana accounts don't get the snap wallet type, they don't join entropy account groups. Minor correction though, it's not for third party snaps, but for "account snaps that do not join entropy account groups" - which includes third party snaps but also the institutional one

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 1st vs 3rd party snap rule for deletion was decided before multichain accounts and institutional snaps. We have to update it now with the new standards

@shane-t shane-t added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 0ca554b Mar 5, 2026
179 checks passed
@shane-t shane-t deleted the shane-t/re-enable-remove-snap-accounts branch March 5, 2026 16:12
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
@metamaskbot metamaskbot added the release-13.22.0 Issue or pull request that will be included in release 13.22.0 label Mar 5, 2026
@chloeYue chloeYue added team-earn and removed team-mobile-ux Mobile UX team labels Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.22.0 Issue or pull request that will be included in release 13.22.0 size-S team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants