Skip to content

release(runway): cherry-pick chore: convert setTimeouts to waitForNextUpdate cp-13.25.0#41315

Merged
chloeYue merged 1 commit into
release/13.25.0from
runway-cherry-pick-13.25.0-1774628925
Mar 27, 2026
Merged

release(runway): cherry-pick chore: convert setTimeouts to waitForNextUpdate cp-13.25.0#41315
chloeYue merged 1 commit into
release/13.25.0from
runway-cherry-pick-13.25.0-1774628925

Conversation

@runway-github

@runway-github runway-github Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Description

Updates a test to use waitForNextUpdate rather than setTimeout, as
setTimeout seemed to be causing some inconsistent results.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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

Low Risk
Test-only changes that update async waiting semantics; low product
risk, with minor risk of altering test reliability if the new waitFor
assertions are too permissive or timing-sensitive.

Overview
Refactors useMerklRewards.test.ts to remove setTimeout/act-based
async flushing and instead wait on specific state transitions via
renderHook’s waitFor.

Cleans up teardown logic (dropping the extra microtask flush) and
makes the geoblocked case explicitly synchronous since the query is
disabled.

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

[667cb0f](https://github.com/MetaMask/metamask-extension/commit/667cb0f3c99672b1307c7f4c3004b34e5dee0d38)

…tUpdate cp-13.25.0 (#41308)

<!--
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**
Updates a test to use waitForNextUpdate rather than setTimeout, as
setTimeout seemed to be causing some inconsistent results.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/41308?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: null

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

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

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Test-only changes that update async waiting semantics; low product
risk, with minor risk of altering test reliability if the new `waitFor`
assertions are too permissive or timing-sensitive.
> 
> **Overview**
> Refactors `useMerklRewards.test.ts` to remove `setTimeout`/`act`-based
async flushing and instead wait on specific state transitions via
`renderHook`’s `waitFor`.
> 
> Cleans up teardown logic (dropping the extra microtask flush) and
makes the geoblocked case explicitly synchronous since the query is
disabled.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
014f0f8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@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.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 27, 2026
@metamaskbotv2

metamaskbotv2 Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/metamask-earn (1 files, +50 -67)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 musd/
          • 📁 hooks/
            • 📄 useMerklRewards.test.ts +50 -67

@chloeYue chloeYue 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.

LGTM

@sonarqubecloud

Copy link
Copy Markdown

@metamaskbotv2

metamaskbotv2 Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor
Builds ready [03aa141]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account32629736227356362
total32629736227356362
Confirm Txconfirm_tx6114607161663661326166
total6114607161663661326166
Bridge User Actionsbridge_load_page31427636035349360
bridge_load_asset_picker25417331451301314
bridge_search_token73070374918743749
total1309126513753913301375
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Chrome Browserify Startup Standard HomeuiStartup14321178175611614941630
load1183969148810512401362
domContentLoaded1174961148110412351350
domInteractive3015120232790
firstPaint222641246233238384
backgroundConnect20318326012207228
firstReactRender20143752131
initialActions107114
loadScripts988778126310210431158
setupStore1373661424
numNetworkReqs393193173184
Chrome Browserify Startup Power User HomeuiStartup443919849522176657077624
load13391176177813713751658
domContentLoaded13161166175912513531586
domInteractive43212534038119
firstPaint3231111510235349573
backgroundConnect15722955534136226973925
firstReactRender25186072740
initialActions107114
loadScripts1108969152211711361358
setupStore1787691934
numNetworkReqs1667628544192254
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172211219221
srpButtonToSrpForm93929419394
confirmSrpToPwForm21212202122
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen15151501515
doneButtonToHomeScreen5335275405533540
openAccountMenuToAccountListLoaded3013292031007330963100
total3920381540117539934011
Onboarding New WalletcreateWalletToSocialScreen2182162201218220
srpButtonToPwForm1141071216120121
createPwToRecoveryScreen888088
skipBackupToMetricsScreen38363913839
agreeButtonToOnboardingSuccess15151501515
doneButtonToAssetList53548566977496669
total9268711056758941056
Asset DetailsassetClickToPriceChart86838828888
total86838828888
Solana Asset DetailsassetClickToPriceChart533566125966
total533566125966
Import Srp HomeloginToHomeScreen2270222023143822972314
openAccountMenuAfterLogin654785137385
homeAfterImportWithNewWallet2336224624246623652424
total4634461446722746724672
Send TransactionsopenSendPageFromHome34244163941
selectTokenToSendFormLoaded36304773847
reviewTransactionToConfirmationPage1138934136914512091369
total12201054143813112801438
SwapopenSwapPageFromHome84681101590110
fetchAndDisplaySwapQuotes269926962702327012702
total2777276427861027852786
🌐 Dapp Page Load Benchmarks

Current Commit: 03aa141 | Date: 3/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±36ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 746ms (±33ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 87ms (±11ms) 🟢 | historical mean value: 85ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 36ms 1.02s 1.33s 1.08s 1.33s
domContentLoaded 746ms 33ms 712ms 997ms 765ms 997ms
firstPaint 87ms 11ms 68ms 172ms 100ms 172ms
firstContentfulPaint 87ms 11ms 68ms 172ms 100ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 6.84 MiB (100%)
  • ui: 8.35 MiB (100%)
  • common: 11.34 MiB (100%)

@chloeYue chloeYue merged commit a255093 into release/13.25.0 Mar 27, 2026
88 checks passed
@chloeYue chloeYue deleted the runway-cherry-pick-13.25.0-1774628925 branch March 27, 2026 17:08
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants