Skip to content

chore: adjust activity history query stale time#41794

Merged
n3ps merged 1 commit into
mainfrom
n3ps/adjust-txhistory-staletime
Apr 15, 2026
Merged

chore: adjust activity history query stale time#41794
n3ps merged 1 commit into
mainfrom
n3ps/adjust-txhistory-staletime

Conversation

@n3ps

@n3ps n3ps commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Description

Increase the transactions query stale time to 5mins

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
Low risk: only adjusts React Query caching parameters for the transactions infinite query and its prefetch, with test updates to assert the new behavior.

Overview
Adjusts multichain transaction history fetching to treat results as fresh for 5 minutes by adding staleTime: 5 * MINUTE to useTransactionsQuery and the usePrefetchTransactions prefetch call.

Updates the associated hook tests to assert the new staleTime value is passed through to useInfiniteQuery and prefetchInfiniteQuery.

Reviewed by Cursor Bugbot for commit d580ae8. Bugbot is set up for automated code reviews on this repo. Configure here.

@n3ps n3ps requested a review from a team as a code owner April 15, 2026 18:28
@n3ps n3ps changed the title feat: adjust tx history stale time to 5 minutes chore: adjust tx history stale time Apr 15, 2026
@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-core-extension-ux Core Extension UX team label Apr 15, 2026
@metamaskbotv2

metamaskbotv2 Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/core-extension-ux (2 files, +9 -2)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 activity-v2/
          • 📄 hooks.test.tsx +2 -1
          • 📄 hooks.ts +7 -1

@n3ps n3ps enabled auto-merge April 15, 2026 18:42
@sonarqubecloud

Copy link
Copy Markdown

@n3ps n3ps changed the title chore: adjust tx history stale time chore: adjust activity history query stale time Apr 15, 2026
@metamaskbotv2

metamaskbotv2 Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor
Builds ready [d580ae8]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 10/14/58243 | Pipeline: 24471307051 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-browserify
loadNewAccount🟡 [Show logs]
confirmTx🟡 [Show logs]
bridgeUserActions🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -21%
  • loadNewAccount/total: -21%
  • bridgeUserActions/bridge_load_asset_picker: -12%
  • bridgeUserActions/bridge_search_token: +46%
  • bridgeUserActions/total: +26%

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

  • 🟡 loadNewAccount/FCP: p75 2.6s
  • 🟡 confirmTx/FCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.5s
Startup Benchmarks · Samples: 100
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -20%
  • startupStandardHome/domInteractive: +11%
  • startupStandardHome/backgroundConnect: +13%
  • startupStandardHome/firstReactRender: -14%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -13%
  • startupPowerUserHome/uiStartup: -25%
  • startupPowerUserHome/backgroundConnect: +101%
  • startupPowerUserHome/setupStore: +15%
  • startupPowerUserHome/numNetworkReqs: +21%
  • startupStandardHome/uiStartup: -18%
  • startupStandardHome/load: -14%
  • startupStandardHome/domContentLoaded: -13%
  • startupStandardHome/firstPaint: +20%
  • startupStandardHome/backgroundConnect: -29%
  • startupStandardHome/firstReactRender: -19%
  • startupStandardHome/loadScripts: -13%
  • startupStandardHome/numNetworkReqs: -29%
  • startupPowerUserHome/uiStartup: -26%
  • startupPowerUserHome/domInteractive: -21%
  • startupPowerUserHome/numNetworkReqs: +19%
  • startupStandardHome/uiStartup: -26%
  • startupStandardHome/load: -19%
  • startupStandardHome/domContentLoaded: -19%
  • startupStandardHome/domInteractive: -48%
  • startupStandardHome/firstReactRender: -26%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -19%
  • startupStandardHome/numNetworkReqs: -13%
  • startupPowerUserHome/uiStartup: -31%
  • startupPowerUserHome/backgroundConnect: -19%
  • startupStandardHome/uiStartup: -11%
  • startupStandardHome/domInteractive: -33%
  • startupStandardHome/initialActions: -43%
  • startupStandardHome/setupStore: -54%
  • startupStandardHome/numNetworkReqs: -13%
  • startupPowerUserHome/uiStartup: -36%
  • startupPowerUserHome/load: -11%
  • startupPowerUserHome/domContentLoaded: -11%
  • startupPowerUserHome/domInteractive: -17%
  • startupPowerUserHome/backgroundConnect: -26%
  • startupPowerUserHome/firstReactRender: -31%
  • startupPowerUserHome/loadScripts: -11%
  • startupPowerUserHome/setupStore: -44%

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

  • 🔴 startupPowerUserHome/INP: p75 776ms
  • 🔴 startupPowerUserHome/INP: p75 768ms
  • 🟡 startupPowerUserHome/LCP: p75 3.7s
  • 🟡 startupPowerUserHome/LCP: p75 3.1s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟡 [Show logs]
solanaAssetDetails🟡 [Show logs]
importSrpHome🟡 [Show logs]
sendTransactions🟡 [Show logs]
swap🟡 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -87%
  • onboardingImportWallet/confirmSrpToPwForm: -21%
  • onboardingImportWallet/pwFormToMetricsScreen: -22%
  • onboardingImportWallet/metricsToWalletReadyScreen: -60%
  • onboardingImportWallet/doneButtonToHomeScreen: -77%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +16%
  • onboardingImportWallet/total: -49%
  • onboardingNewWallet/srpButtonToPwForm: -78%
  • onboardingNewWallet/skipBackupToMetricsScreen: -68%
  • onboardingNewWallet/doneButtonToAssetList: -24%
  • onboardingNewWallet/total: -25%
  • assetDetails/assetClickToPriceChart: -45%
  • assetDetails/total: -45%
  • solanaAssetDetails/assetClickToPriceChart: -72%
  • solanaAssetDetails/total: -72%
  • importSrpHome/openAccountMenuAfterLogin: -78%
  • importSrpHome/homeAfterImportWithNewWallet: -70%
  • importSrpHome/total: -61%
  • sendTransactions/openSendPageFromHome: -21%
  • sendTransactions/selectTokenToSendFormLoaded: -32%
  • sendTransactions/reviewTransactionToConfirmationPage: +34%
  • sendTransactions/total: +31%
  • swap/openSwapPageFromHome: -95%
  • swap/fetchAndDisplaySwapQuotes: +31%
  • swap/total: +11%

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

  • 🟡 assetDetails/INP: p75 224ms
  • 🟡 assetDetails/FCP: p75 2.5s
  • 🟡 solanaAssetDetails/FCP: p75 2.5s
  • 🟡 importSrpHome/INP: p75 216ms
  • 🟡 importSrpHome/FCP: p75 2.5s
  • 🟡 sendTransactions/INP: p75 232ms
  • 🟡 sendTransactions/FCP: p75 2.5s
  • 🟡 swap/FCP: p75 2.5s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-browserify
dappPageLoad🟢 [Show logs]
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 129 Bytes (0%)
  • common: 20 Bytes (0%)

@n3ps n3ps added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 37b8d30 Apr 15, 2026
227 of 229 checks passed
@n3ps n3ps deleted the n3ps/adjust-txhistory-staletime branch April 15, 2026 20:14
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
@metamaskbot metamaskbot added the release-13.28.0 Issue or pull request that will be included in release 13.28.0 label Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.28.0 Issue or pull request that will be included in release 13.28.0 size-S team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants