Skip to content

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Nov 28, 2025

Description

Fixes a crash caused by useMultichainAccountsIntroModal that entirely
bricks Flask. The crash occurs because the version handling doesn't
handle our versioning scheme well. This PR changes the logic to use
previousAppVersion and strips the prerelease part of the version
(which indicates the build type) for a proper comparison.

Also updates the tests for this hook which were flawed as they didn't
use the hook in question at all.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Fixes a crash when updating Flask

Manual testing steps

  1. Force lastUpdatedFromVersion to 13.9.0.150 and
    previousAppVersion to 13.9.0-flask.0
  2. See that it crashes without this PR

Screenshots/Recordings

Before

image


Note

Fixes modal logic by parsing/stripping prerelease versions and using previousAppVersion, preventing crashes; rewrites tests to exercise the hook with provider-backed state.

  • Hook (ui/hooks/useMultichainAccountsIntroModal.ts):
    • Export BIP44_ACCOUNTS_INTRODUCTION_VERSION and switch version source to state.metamask.previousAppVersion.
    • Parse versions with semver.parse and strip prerelease before comparing with semver.lt.
    • Maintain display conditions (unlocked, feature flag, not previously shown, upgrade, main route) and set showMultichainIntroModal accordingly.
  • Tests (ui/hooks/useMultichainAccountsIntroModal.test.ts):
    • Replace standalone logic tests with renderHookWithProvider to test the actual hook.
    • Add cases for prerelease versions (e.g., 13.4.0-flask.0) and threshold boundaries; verify behavior across route, lock state, feature flag, prior display, and fresh install.

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

a3c1ac2

…ling cp-13.11.1 (#38382)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Fixes a crash caused by `useMultichainAccountsIntroModal` that entirely
bricks Flask. The crash occurs because the version handling doesn't
handle our versioning scheme well. This PR changes the logic to use
`previousAppVersion` and strips the `prerelease` part of the version
(which indicates the build type) for a proper comparison.

Also updates the tests for this hook which were flawed as they didn't
use the hook in question at all.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/38382?quickstart=1)

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Fixes a crash when updating Flask

## **Manual testing steps**

1. Force `lastUpdatedFromVersion` to `13.9.0.150` and
`previousAppVersion` to `13.9.0-flask.0`
2. See that it crashes without this PR

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="454" height="634" alt="image"
src="https://github.com/user-attachments/assets/ea140cfa-66ef-402e-a6cd-3ca3a2bc6402"
/>


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Use `previousAppVersion` and strip prerelease parts for version
comparison in `useMultichainAccountsIntroModal`; update tests to
exercise the hook with provider-backed state.
> 
> - **Hooks** (`ui/hooks/useMultichainAccountsIntroModal.ts`):
> - Use `previousAppVersion` instead of `lastUpdatedFromVersion` for
upgrade checks.
> - Parse and strip prerelease identifiers via `semver.parse` before
comparing with `BIP44_ACCOUNTS_INTRODUCTION_VERSION` using `semver.lt`.
>   - Export `BIP44_ACCOUNTS_INTRODUCTION_VERSION` for external use.
> - Maintain display gating by `DEFAULT_ROUTE` and existing state flags;
compute and set `showMultichainIntroModal` accordingly.
> - **Tests** (`ui/hooks/useMultichainAccountsIntroModal.test.ts`):
> - Replace ad-hoc logic with `renderHookWithProvider` to test the
actual hook.
> - Cover upgrades across thresholds including prerelease versions
(e.g., `*-flask.0`) and ensure correct show/hide behavior across routes
and states.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9d7267f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Nov 28, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [a46d32a]
UI Startup Metrics (1217 ± 99 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1217104616699912691354
load104690614199011081193
domContentLoaded103989814138810961178
domInteractive2313111172063
firstPaint57498121742610591168
backgroundConnect2091932438213225
firstReactRender27196992946
getState31157093750
initialActions102112
loadScripts836679119488896961
setupStore1052631118
numNetworkReqs1257820574
BrowserifyPower User HomeuiStartup18591607281418319362259
load97686319071759491410
domContentLoaded96184518851749351402
domInteractive34161943428126
firstPaint64316819074009291371
backgroundConnect21319626113218244
firstReactRender84411552293133
getState18014325526201232
initialActions104112
loadScripts76565516551707401196
setupStore1995692240
numNetworkReqs1376830753176271
WebpackStandard HomeuiStartup811724106067835960
load61656085768620781
domContentLoaded61155685068616775
domInteractive2514100192281
firstPaint22773856164204627
backgroundConnect1153371429
firstReactRender29214153338
getState281266103344
initialActions103112
loadScripts60855484066614766
setupStore1253251420
numNetworkReqs1257720573
WebpackPower User HomeuiStartup14651232215414415561710
load6845931280109678956
domContentLoaded6735871272109665945
domInteractive34171432733114
firstPaint2731121278203260713
backgroundConnect1584651822
firstReactRender8143104149199
getState15312522417160191
initialActions102011
loadScripts6705841258107662935
setupStore21855102444
numNetworkReqs1486430350185253
FirefoxBrowserifyStandard HomeuiStartup12501075160811213111472
load105192213548211091193
domContentLoaded105092113548211081192
domInteractive60311633383133
firstPaint------
backgroundConnect352084143975
firstReactRender22183642234
getState12696131032
initialActions103122
loadScripts102990513317910821172
setupStore1167891221
numNetworkReqs1156416662
BrowserifyPower User HomeuiStartup24011929312026825842899
load1111925164515311181512
domContentLoaded1110925164415311181512
domInteractive11832532106110437
firstPaint------
backgroundConnect1042784395116256
firstReactRender80391312194123
getState261651244234313782
initialActions2133326
loadScripts1080911155114410931444
setupStore1437807195131670
numNetworkReqs92502204385213
WebpackStandard HomeuiStartup14971319206412315311749
load1272111114768513331414
domContentLoaded1272111114758513321414
domInteractive63282003585131
firstPaint------
backgroundConnect4421233264598
firstReactRender28218883036
getState1165071123
initialActions113022
loadScripts1247108214358113071387
setupStore147167181239
numNetworkReqs1156416760
WebpackPower User HomeuiStartup26882179333728328973229
load13731182192618414291796
domContentLoaded13731182192518414291796
domInteractive12431651127110451
firstPaint------
backgroundConnect1033050463121171
firstReactRender84362293291170
getState26584887226390752
initialActions416810232
loadScripts13401143188518313941776
setupStore1376770191146720
numNetworkReqs90532254281197
📊 Page Load Benchmark Results

Current Commit: a46d32a | Date: 11/28/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.07s (±76ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 751ms (±72ms) 🟢 | historical mean value: 727ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.07s 76ms 1.02s 1.42s 1.30s 1.42s
domContentLoaded 751ms 72ms 712ms 1.06s 967ms 1.06s
firstPaint 78ms 11ms 60ms 156ms 92ms 156ms
firstContentfulPaint 78ms 11ms 60ms 156ms 92ms 156ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

@gauthierpetetin gauthierpetetin merged commit 86ef0b6 into release/13.11.1 Nov 28, 2025
331 of 335 checks passed
@gauthierpetetin gauthierpetetin deleted the runway-cherry-pick-13.11.1-1764331381 branch November 28, 2025 13:09
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2025
@metamaskbot metamaskbot added the release-13.11.1 Issue or pull request that will be included in release 13.11.1 label Nov 28, 2025
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-13.11.1 on PR, as PR was cherry-picked in branch 13.11.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.11.1 Issue or pull request that will be included in release 13.11.1 team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants