Skip to content

fix: swap activity history details#40993

Merged
n3ps merged 2 commits intomainfrom
n3ps/mitigate-swap-txn-details
Mar 18, 2026
Merged

fix: swap activity history details#40993
n3ps merged 2 commits intomainfrom
n3ps/mitigate-swap-txn-details

Conversation

@n3ps
Copy link
Copy Markdown
Contributor

@n3ps n3ps commented Mar 18, 2026

Description

Mitigate an issue where state passed via useNavigate is not serialized correctly.

For a better long-term design, prefer to retrieve data from the receiving page.

Changelog

CHANGELOG entry: fix: swap activity history details

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

swap-detail.mov

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 UI navigation change that only affects how transaction data is passed via useNavigate, reducing failures caused by non-serializable values like bigint. Potential risk is minor: downstream consumers may now receive stringified bigint fields instead of native bigint.

Overview
Fixes swap/bridge activity details navigation by serializing txMeta before passing it in navigate state for CROSS_CHAIN_SWAP_TX_DETAILS_ROUTE.

Adds a recursive serialize helper that converts bigint values to strings (and walks arrays/objects) to avoid non-serializable history state being pushed through React Router; includes a TODO to eventually fetch details on the destination route instead.

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

@n3ps n3ps requested a review from a team as a code owner March 18, 2026 02:19
@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 Mar 18, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 18, 2026

✨ Files requiring CODEOWNER review ✨

🔄 @MetaMask/swaps-engineers (1 files, +26 -1)
  • 📁 ui/
    • 📁 hooks/
      • 📁 bridge/
        • 📄 useBridgeTxHistoryData.ts +26 -1

Copy link
Copy Markdown

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

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 18, 2026

Builds ready [a0072a4]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29328230812308308
total29328230812308308
Confirm Txconfirm_tx6048602360661660556066
total6048602360661660556066
Bridge User Actionsbridge_load_page28421232442319324
bridge_load_asset_picker22115926744263267
bridge_search_token76673182032785820
total1292126413252312971325
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14681225204211514911674
load12171014165610412431394
domContentLoaded12111009164910212401385
domInteractive3116174242682
firstPaint159721258133207274
backgroundConnect21519626913219245
firstReactRender20134052132
initialActions107124
loadScripts1011815143710110401184
setupStore1363261624
numNetworkReqs393187163777
Power User HomeuiStartup5719213614991249365378559
load13571141190214413971704
domContentLoaded13321136185213713601661
domInteractive39202223932137
firstPaint229811312154286445
backgroundConnect169631412539241312885565
firstReactRender25165262638
initialActions106113
loadScripts1095922161512911301417
setupStore1566791731
numNetworkReqs1998636461231313
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182162201219220
srpButtonToSrpForm92919419394
confirmSrpToPwForm22222202222
pwFormToMetricsScreen15141601516
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen63156067244666672
openAccountMenuToAccountListLoaded28502484312622529653126
total3895384839524339523952
Onboarding New WalletcreateWalletToSocialScreen2192182190219219
srpButtonToPwForm1121091142113114
createPwToRecoveryScreen989099
skipBackupToMetricsScreen40404104141
agreeButtonToOnboardingSuccess17161811718
doneButtonToAssetList50848952916518529
total90988894220915942
Asset DetailsassetClickToPriceChart645079117179
total645079117179
Solana Asset DetailsassetClickToPriceChart953616444117164
total953616444117164
Import Srp HomeloginToHomeScreen24092252255410824402554
openAccountMenuAfterLogin57526455864
homeAfterImportWithNewWallet1351512277595622232775
total390629665709106145275709
Send TransactionsopenSendPageFromHome412771174871
selectTokenToSendFormLoaded35303833738
reviewTransactionToConfirmationPage1123810132618112401326
total1199896138917813041389
SwapopenSwapPageFromHome11510012811122128
fetchAndDisplaySwapQuotes269626892709826962709
total2835280228823028372882
🌐 Dapp Page Load Benchmarks

Current Commit: a0072a4 | Date: 3/18/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 980ms (±39ms) 🟢 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 689ms (±59ms) 🟢 | historical mean value: 724ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±38ms) 🟢 | historical mean value: 88ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 980ms 39ms 951ms 1.27s 1.01s 1.27s
domContentLoaded 689ms 59ms 663ms 1.23s 708ms 1.23s
firstPaint 80ms 38ms 64ms 452ms 84ms 452ms
firstContentfulPaint 80ms 38ms 64ms 452ms 84ms 452ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 284 Bytes (0%)
  • common: 20 Bytes (0%)

@n3ps n3ps enabled auto-merge March 18, 2026 03:09
@sonarqubecloud
Copy link
Copy Markdown

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Mar 18, 2026

Builds ready [9dff676]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29227831514288315
total29227831514288315
Confirm Txconfirm_tx6057604260751460736075
total6057604260751460736075
Bridge User Actionsbridge_load_page23518826528263265
bridge_load_asset_picker25822428322280283
bridge_search_token77273083035790830
total1266120213545613001354
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14891235185310215161698
load1232103815168912691398
domContentLoaded1225103315078712641386
domInteractive3017110212685
firstPaint158721297138214267
backgroundConnect21920330515223246
firstReactRender2212261252133
initialActions109124
loadScripts102283412988710641181
setupStore1574461725
numNetworkReqs393184154075
Power User HomeuiStartup64031910180293168686114799
load14131167303128314191765
domContentLoaded13921160300528013901746
domInteractive43202904436146
firstPaint21277592110293413
backgroundConnect2791334147423163364711848
firstReactRender25186762634
initialActions106113
loadScripts1132920268420611511432
setupStore1564361727
numNetworkReqs1759531555200298
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192192200220220
srpButtonToSrpForm99941043100104
confirmSrpToPwForm23222312323
pwFormToMetricsScreen16151601616
metricsToWalletReadyScreen16151711617
doneButtonToHomeScreen62259169543601695
openAccountMenuToAccountListLoaded2936292029451129452945
total3927390539732739193973
Onboarding New WalletcreateWalletToSocialScreen2202192200220220
srpButtonToPwForm1081071091109109
createPwToRecoveryScreen889089
skipBackupToMetricsScreen39394003940
agreeButtonToOnboardingSuccess16151711717
doneButtonToAssetList58449470997696709
total98488411019510901101
Asset DetailsassetClickToPriceChart81808218282
total81808218282
Solana Asset DetailsassetClickToPriceChart833112132113121
total833112132113121
Import Srp HomeloginToHomeScreen27362452313826027783138
openAccountMenuAfterLogin50396075260
homeAfterImportWithNewWallet15904462888112125162888
total437631336086123750206086
Send TransactionsopenSendPageFromHome29283113131
selectTokenToSendFormLoaded30253853338
reviewTransactionToConfirmationPage1268119313676712871367
total1328126214246413481424
SwapopenSwapPageFromHome1075914032133140
fetchAndDisplaySwapQuotes269226882695226932695
total2799274728303328252830
🌐 Dapp Page Load Benchmarks

Current Commit: 9dff676 | Date: 3/18/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±42ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 726ms (±64ms) 🟢 | historical mean value: 726ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 83ms (±43ms) 🟢 | historical mean value: 85ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 42ms 1.01s 1.36s 1.06s 1.36s
domContentLoaded 726ms 64ms 702ms 1.31s 757ms 1.31s
firstPaint 83ms 43ms 64ms 512ms 88ms 512ms
firstContentfulPaint 83ms 43ms 64ms 512ms 88ms 512ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 284 Bytes (0%)
  • common: 20 Bytes (0%)

Copy link
Copy Markdown
Contributor

@SteP-n-s SteP-n-s left a comment

Choose a reason for hiding this comment

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

Non‑blocking comment: is the serialize function specifically implemented for bridge needs, or can it be used in other parts of the app as well? Looking at the logic, it seems more like a generic utility rather than something bound to the Swaps feature.

@n3ps n3ps added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit fa7d63d Mar 18, 2026
206 checks passed
@n3ps n3ps deleted the n3ps/mitigate-swap-txn-details branch March 18, 2026 18:30
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2026
@metamaskbot metamaskbot added the release-13.24.0 Issue or pull request that will be included in release 13.24.0 label Mar 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.24.0 Issue or pull request that will be included in release 13.24.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