Skip to content

fix: change pre-installed snaps order#42814

Merged
Prithpal-Sooriya merged 1 commit into
mainfrom
fix/change-pre-installed-snap-order
May 20, 2026
Merged

fix: change pre-installed snaps order#42814
Prithpal-Sooriya merged 1 commit into
mainfrom
fix/change-pre-installed-snap-order

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description

This resolves a weird issue where the TRON snap is not loaded on startup causing issues with Asset Balances for TRON. This is first time install issue, closing and opening fixes. Convo here: https://consensys.slack.com/archives/CTQAGKY5V/p1779204701371199

But the underlying issue still needs debugging.

  1. Is the background waiting for all snaps to load before initialising engine, or are there floating promises?
  2. Why does this order changing resolve our issues, is there a recent change on the Tron Snap?

We have a longer term, improved, fix on our Assets Controllers side here: MetaMask/core#8862


EDIT

Doing some digging, the preinstalled snaps are installed correctly inside the background.js with no floating promises.
However the SnapController.init() - which processes these preinstalled snaps - is a floating promise.
So while all other controllers are loading, the SnapController may not have finished its init().

  • Front loading the non-evm snaps biases the startup reducing the chance of missing non-EVM snaps on first install.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensys.slack.com/archives/CTQAGKY5V/p1779204701371199

Manual testing steps

  1. Fresh app install
  2. Navigate to TRON
  3. EXPECTED: see if TRON native tokens are available.

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.

there is a long term issue with how we load in preinstalled snaps on extension initialisation
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2

metamaskbotv2 Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

🫰 @MetaMask/core-platform (1 files, +15 -15)
  • 📁 app/
    • 📁 scripts/
      • 📁 constants/
        • 📄 snaps.ts +15 -15

Comment thread app/scripts/constants/snaps.ts
@sonarqubecloud

Copy link
Copy Markdown

@metamaskbotv2

metamaskbotv2 Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor
Builds ready [b96192a]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 9 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 26161693372 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -78%
  • loadNewAccount/total: -78%
  • bridgeUserActions/bridge_load_page: -40%
  • bridgeUserActions/bridge_load_asset_picker: -67%
  • bridgeUserActions/bridge_search_token: -32%
  • bridgeUserActions/total: -40%
  • loadNewAccount/load_new_account: -49%
  • loadNewAccount/total: -49%
  • bridgeUserActions/bridge_load_page: +28%
  • bridgeUserActions/bridge_search_token: -33%
  • bridgeUserActions/total: -19%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 confirmTx/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -22%
  • startupStandardHome/load: -17%
  • startupStandardHome/domContentLoaded: -17%
  • startupStandardHome/domInteractive: -10%
  • startupStandardHome/firstPaint: -39%
  • startupStandardHome/backgroundConnect: -42%
  • startupStandardHome/firstReactRender: -30%
  • startupStandardHome/loadScripts: -17%
  • startupStandardHome/numNetworkReqs: -29%
  • startupStandardHome/load: +14%
  • startupStandardHome/domContentLoaded: +14%
  • startupStandardHome/domInteractive: -35%
  • startupStandardHome/backgroundConnect: +19%
  • startupStandardHome/firstReactRender: +17%
  • startupStandardHome/initialActions: +20%
  • startupStandardHome/loadScripts: +14%
  • startupStandardHome/setupStore: -39%
  • startupStandardHome/numNetworkReqs: -21%
  • startupPowerUserHome/uiStartup: -44%
  • startupPowerUserHome/domInteractive: -77%
  • startupPowerUserHome/backgroundConnect: -75%
  • startupPowerUserHome/setupStore: -87%
  • startupPowerUserHome/numNetworkReqs: -66%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 startupPowerUserHome/LCP: p75 2.9s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
assetDetails
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -81%
  • onboardingImportWallet/pwFormToMetricsScreen: +587%
  • onboardingImportWallet/metricsToWalletReadyScreen: -16%
  • onboardingImportWallet/doneButtonToHomeScreen: -81%
  • onboardingImportWallet/total: -49%
  • onboardingNewWallet/srpButtonToPwForm: -78%
  • onboardingNewWallet/createPwToRecoveryScreen: +1054%
  • onboardingNewWallet/skipBackupToMetricsScreen: -68%
  • onboardingNewWallet/doneButtonToAssetList: -55%
  • onboardingNewWallet/total: -47%
  • assetDetails/assetClickToPriceChart: -66%
  • assetDetails/total: -66%
  • solanaAssetDetails/assetClickToPriceChart: -70%
  • solanaAssetDetails/total: -70%
  • importSrpHome/loginToHomeScreen: -42%
  • importSrpHome/openAccountMenuAfterLogin: -72%
  • importSrpHome/homeAfterImportWithNewWallet: -69%
  • importSrpHome/total: -66%
  • swap/openSwapPageFromHome: -97%
  • swap/fetchAndDisplaySwapQuotes: +35%
  • swap/total: +12%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 assetDetails/INP: p75 232ms
  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.9s
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 sendTransactions/INP: p75 224ms
  • 🟡 sendTransactions/FCP: p75 1.9s
  • 🟡 swap/FCP: p75 1.9s
  • 🟡 sendTransactions/FCP: p75 1.9s
  • 🟡 swap/FCP: p75 1.8s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: +26%
Bundle size diffs
  • background: 16 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review May 20, 2026 13:41
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner May 20, 2026 13:41
@Prithpal-Sooriya Prithpal-Sooriya added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 20, 2026

@NidhiKJha NidhiKJha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @Prithpal-Sooriya thanks for the fix, it resolves the issue on Tron but I am still not able to import on Solana. I think it's related?
https://github.com/user-attachments/assets/10e6a9d6-b8d8-4990-99f7-b157d4a1bb12

@Prithpal-Sooriya

Copy link
Copy Markdown
Contributor Author

Hey @Prithpal-Sooriya thanks for the fix, it resolves the issue on Tron but I am still not able to import on Solana. I think it's related? https://github.com/user-attachments/assets/10e6a9d6-b8d8-4990-99f7-b157d4a1bb12

Thanks @NidhiKJha replied in our slack thread. Was another unrelated change due to a recent accounts-api network addition that caused a behaviour regression

@mcmire mcmire left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Definitely strange, but seems like a benign change.

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit c862d85 May 20, 2026
235 of 241 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the fix/change-pre-installed-snap-order branch May 20, 2026 19:14
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
@metamaskbot metamaskbot added the release-13.33.0 Issue or pull request that will be included in release 13.33.0 label May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.33.0 Issue or pull request that will be included in release 13.33.0 size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants