Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Nov 21, 2025

Description

Request for quotes should only be send for valid confirmation

Changelog

CHANGELOG entry:

Related issues

Fixes: MetaMask/metamask-mobile#23100

Manual testing steps

  1. Trigger a contract interaction from test-dapp
  2. Ensure that quote request is not send for it and also metrics not recorded

Screenshots/Recordings

NA

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

Gate dapp-swap quote fetching behind a remote flag, move fee/walletAddress injection to middleware, simplify getDataFromSwap, and update UI metrics/tests accordingly.

  • Dapp Swap Middleware:
    • Accepts dappSwapMetricsFlag and short-circuits when disabled; prevents quote fetching when off.
    • Derives quotesInput via getDataFromSwap(chainId, data) and augments it with walletAddress and fee (from flag or default) before fetchQuotes.
    • Wired in metamask-controller with remoteFeatureFlags.dappSwapMetrics.
  • Shared Utils (dapp-swap-comparison-utils):
    • Simplify getDataFromSwap signature (remove walletAddress/fee concerns) and return raw quotesInput.
    • Remove GenericQuoteRequest/default fee from utils.
  • UI:
    • Banner: only captures display metric when the banner actually shows.
    • Hook useDappSwapComparisonInfo: update to use new getDataFromSwap(chainId, data) and handle possibly undefined commands.
  • Tests:
    • Add test ensuring no quotes fetched when feature flag disabled.
    • Update middleware/tests to expect fee and walletAddress added in middleware and new getDataFromSwap shape.

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

@jpuri jpuri added team-confirmations Push issues to confirmations team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Nov 21, 2025
@github-actions
Copy link
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
Copy link
Collaborator

metamaskbot commented Nov 21, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (2 files, +5 -12)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 dapp-swap-comparison-banner/
              • 📄 dapp-swap-comparison-banner.tsx +3 -5
        • 📁 hooks/
          • 📁 transactions/
            • 📁 dapp-swap-comparison/
              • 📄 useDappSwapComparisonInfo.ts +2 -7

@jpuri jpuri marked this pull request as ready for review November 21, 2025 13:16
@jpuri jpuri requested a review from a team as a code owner November 21, 2025 13:16
@jpuri jpuri enabled auto-merge November 21, 2025 13:16
@jpuri jpuri changed the title fix: sending quote request for only valid swaps fix: cp-13.11.0 sending quote request for only valid swaps Nov 21, 2025
if (swapComparisonDisplayed) {
dappSwapComparisonDisplayed = true;
captureDappSwapComparisonDisplayProperties({
swap_mm_cta_displayed: 'true',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @bschorchit : for swap_mm_cta_displayed we need to take missing value as false.

@metamaskbot
Copy link
Collaborator

Builds ready [99d90fe]
UI Startup Metrics (1215 ± 91 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1215106414089112951373
load102887211988510921171
domContentLoaded102083111918610861166
domInteractive231486182073
firstPaint55889119639310091149
backgroundConnect21419428615217245
firstReactRender301986103550
getState341874114057
initialActions103112
loadScripts81564198985877957
setupStore1172541220
numNetworkReqs1257721576
BrowserifyPower User HomeuiStartup18971612297526620582467
load1021883191617510231476
domContentLoaded1005874188217210011439
domInteractive38162734430155
firstPaint5477519344269341426
backgroundConnect22620228614233253
firstReactRender79451421485106
getState17613134537186253
initialActions107113
loadScripts79767916791727971226
setupStore20751112644
numNetworkReqs1396426750182252
WebpackStandard HomeuiStartup814737105970839979
load61756083565619790
domContentLoaded61255682964615783
domInteractive2515106202184
firstPaint25280808187237643
backgroundConnect1153471428
firstReactRender3021135123339
getState281363103649
initialActions104112
loadScripts60955482062613773
setupStore1253651420
numNetworkReqs1257620571
WebpackPower User HomeuiStartup14181187232624215951907
load66657913351346811000
domContentLoaded6555711327133664992
domInteractive38163574929157
firstPaint276931095202294674
backgroundConnect1473261826
firstReactRender7950108118699
getState15112127236171234
initialActions103112
loadScripts6535691315131662983
setupStore20861132550
numNetworkReqs89641933297176
FirefoxBrowserifyStandard HomeuiStartup12571067157011313271511
load106091212568311181208
domContentLoaded105891212568311181208
domInteractive58301733083104
firstPaint------
backgroundConnect3822114184086
firstReactRender22184642330
getState106566919
initialActions103012
loadScripts103789712357810861188
setupStore14517825933
numNetworkReqs1157115656
BrowserifyPower User HomeuiStartup26041816354330827753285
load1138898159717612101503
domContentLoaded1137898159717612101496
domInteractive13230533118155456
firstPaint------
backgroundConnect16523836192191669
firstReactRender84401431990125
getState22381904234172867
initialActions2122226
loadScripts1106879157917311571483
setupStore1396798212139748
numNetworkReqs87532074182192
WebpackStandard HomeuiStartup14481288197612314781741
load1231110214888612741393
domContentLoaded1231110114888612741392
domInteractive67242623981133
firstPaint------
backgroundConnect40181362243100
firstReactRender27206962935
getState12659111248
initialActions102122
loadScripts1207106514628212501357
setupStore135164181039
numNetworkReqs1156816663
WebpackPower User HomeuiStartup30022304422638332233808
load14781149204023516461947
domContentLoaded14781148204023516451946
domInteractive14830723151158542
firstPaint------
backgroundConnect20824832214268702
firstReactRender91432012598135
getState26683909263214870
initialActions51671037
loadScripts14371132201622915891927
setupStore108776318483710
numNetworkReqs88522174482205
📊 Page Load Benchmark Results

Current Commit: 99d90fe | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±45ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 723ms (±43ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±15ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 45ms 1.01s 1.42s 1.05s 1.42s
domContentLoaded 723ms 43ms 699ms 1.08s 740ms 1.08s
firstPaint 76ms 15ms 56ms 204ms 88ms 204ms
firstContentfulPaint 76ms 15ms 56ms 204ms 88ms 204ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 72 Bytes (0%)
  • ui: -59 Bytes (0%)
  • common: 7 Bytes (0%)


import { decodeCommandV3Path } from '../decoding';

const DEFAULT_QUOTEFEE = 250;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we fetch this from a remote flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated.

@OGPoyraz OGPoyraz self-requested a review November 21, 2025 15:17
@jpuri jpuri requested a review from cryptotavares November 24, 2025 05:41
@metamaskbot
Copy link
Collaborator

Builds ready [ecfc276]
UI Startup Metrics (1266 ± 121 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12661102163912113161536
load103687212949910941219
domContentLoaded1027867127710010891210
domInteractive2614124222289
firstPaint59589129141210161208
backgroundConnect21619333020220247
firstReactRender3624150163564
getState57221252365114
initialActions108113
loadScripts820664107599878995
setupStore13775101324
numNetworkReqs41281463430144
BrowserifyPower User HomeuiStartup18581524299627320222383
load99086418341759931457
domContentLoaded97685618181749721443
domInteractive35151673726143
firstPaint5128415743829071406
backgroundConnect21819826912223244
firstReactRender79481361486103
getState17212035642178285
initialActions104112
loadScripts77465915841717681233
setupStore19860112541
numNetworkReqs996427840114182
WebpackStandard HomeuiStartup8497711132968521118
load62456684669629818
domContentLoaded62056283969624810
domInteractive2514113192280
firstPaint20885820126208579
backgroundConnect1163471230
firstReactRender3421231243660
getState5617116236899
initialActions103112
loadScripts61756082867622801
setupStore17444102041
numNetworkReqs41281493330141
WebpackPower User HomeuiStartup15221247233724616512089
load70759513981457121101
domContentLoaded69558713861446911085
domInteractive39182073932156
firstPaint295901027207339685
backgroundConnect1685071930
firstReactRender85541221292102
getState16313028532169238
initialActions104011
loadScripts69258513771416881073
setupStore23871143551
numNetworkReqs1416930553178272
FirefoxBrowserifyStandard HomeuiStartup13241180197413613431654
load103993213548010711252
domContentLoaded103893213548110711252
domInteractive55301433181131
firstPaint------
backgroundConnect51242503257110
firstReactRender23185072343
getState2411194232152
initialActions103122
loadScripts101791912947310331187
setupStore21879132052
numNetworkReqs39281292633120
BrowserifyPower User HomeuiStartup26621890385937128403425
load1164952159717512571546
domContentLoaded1163946159617612531545
domInteractive14630584128165482
firstPaint------
backgroundConnect220241019258279935
firstReactRender86531381796119
getState24883905247205846
initialActions3022327
loadScripts1123919157216712061513
setupStore1287782185113647
numNetworkReqs89582244085186
WebpackStandard HomeuiStartup15381375216714815861890
load1244110616169512891481
domContentLoaded1244110616119512891481
domInteractive57271843379127
firstPaint------
backgroundConnect53212273260104
firstReactRender30207083441
getState2611177292375
initialActions206123
loadScripts1221109015209012671427
setupStore21791142047
numNetworkReqs39281292532112
WebpackPower User HomeuiStartup28612156372532331023532
load14101112214920515461756
domContentLoaded14101112214920515461755
domInteractive12529709134140480
firstPaint------
backgroundConnect18326863207209719
firstReactRender86431661794118
getState30584896283470839
initialActions3160627
loadScripts13781093212420215101719
setupStore81679312980332
numNetworkReqs91612204586203
📊 Page Load Benchmark Results

Current Commit: ecfc276 | Date: 11/24/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 717ms (±36ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±11ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.01s 1.32s 1.06s 1.32s
domContentLoaded 717ms 36ms 698ms 988ms 736ms 988ms
firstPaint 75ms 11ms 60ms 164ms 88ms 164ms
firstContentfulPaint 75ms 11ms 60ms 164ms 88ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 349 Bytes (0.01%)
  • ui: -59 Bytes (0%)
  • common: -15 Bytes (0%)

@metamaskbot
Copy link
Collaborator

Builds ready [c0543d6]
UI Startup Metrics (1242 ± 120 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12421038156512012821526
load1024852123910110741219
domContentLoaded1018846122110010671211
domInteractive2715106242099
firstPaint5708412323989901098
backgroundConnect2081902399213227
firstReactRender33237593451
getState54181322256107
initialActions107112
loadScripts8166471014978631005
setupStore1163031217
numNetworkReqs41281483432143
BrowserifyPower User HomeuiStartup18091517287125219462412
load95482620071849551439
domContentLoaded94081919801829381429
domInteractive36152364528181
firstPaint61711219953859021363
backgroundConnect20117924812206225
firstReactRender80471371588114
getState17713837438189248
initialActions103112
loadScripts75463617551787541238
setupStore18787122233
numNetworkReqs1336529453170265
WebpackStandard HomeuiStartup84372612011018611095
load63056485477645833
domContentLoaded62655884776641827
domInteractive2714112242299
firstPaint22786773142220619
backgroundConnect96344916
firstReactRender322187113556
getState5216271326696
initialActions103112
loadScripts62355683874639818
setupStore15488121742
numNetworkReqs41281443430142
WebpackPower User HomeuiStartup14481158212724716171952
load67057912061316691026
domContentLoaded66057211851316511018
domInteractive40172204730175
firstPaint25392965164257619
backgroundConnect1464071830
firstReactRender8153120118798
getState16312229642171273
initialActions104112
loadScripts65756911741296491009
setupStore23965153554
numNetworkReqs1456831557180305
FirefoxBrowserifyStandard HomeuiStartup13311163188813913641724
load104392813348610851252
domContentLoaded104292813338610841252
domInteractive57302343577133
firstPaint------
backgroundConnect58232794461135
firstReactRender25187292744
getState2410185202156
initialActions204122
loadScripts101890712918010531212
setupStore2312165192156
numNetworkReqs39281262631119
BrowserifyPower User HomeuiStartup27061798377432628323477
load1189955177118412761567
domContentLoaded1188947177118412761555
domInteractive14535656140151523
firstPaint------
backgroundConnect24028844242379765
firstReactRender88461391896125
getState21266823222178799
initialActions3133427
loadScripts1145932170117412061516
setupStore13310792189124728
numNetworkReqs89572154382202
WebpackStandard HomeuiStartup15741391210815716111928
load12741125172812313231532
domContentLoaded12731125172812313231532
domInteractive53281313280121
firstPaint------
backgroundConnect57192022963126
firstReactRender32227993549
getState239131142447
initialActions213123
loadScripts12461091158111012941509
setupStore23993162165
numNetworkReqs40291252733122
WebpackPower User HomeuiStartup28431979376935730433583
load13771092195420515731766
domContentLoaded13771092195420515731765
domInteractive12329712126130437
firstPaint------
backgroundConnect17224850196211667
firstReactRender893913317100118
getState27283901278213867
initialActions3147537
loadScripts13411066191520315381733
setupStore1217822186119660
numNetworkReqs92612144582206
📊 Page Load Benchmark Results

Current Commit: c0543d6 | Date: 11/24/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±39ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 719ms (±36ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±12ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 39ms 1.01s 1.32s 1.06s 1.32s
domContentLoaded 719ms 36ms 697ms 987ms 747ms 987ms
firstPaint 76ms 12ms 60ms 176ms 84ms 176ms
firstContentfulPaint 76ms 12ms 60ms 176ms 84ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 354 Bytes (0.01%)
  • ui: -59 Bytes (0%)
  • common: -15 Bytes (0%)

OGPoyraz
OGPoyraz previously approved these changes Nov 24, 2025
cryptotavares
cryptotavares previously approved these changes Nov 24, 2025
@jpuri jpuri dismissed stale reviews from cryptotavares and OGPoyraz via 99d80da November 25, 2025 04:47
@github-actions github-actions bot added size-M and removed size-S labels Nov 25, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [ca6ffaf]
UI Startup Metrics (1351 ± 136 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup13511169201813613911632
load1099911165610711421282
domContentLoaded1092904164410611291274
domInteractive29161432822114
firstPaint65197165144510951249
backgroundConnect22520526612233251
firstReactRender382172104161
getState60221172172106
initialActions105114
loadScripts87569614251069141062
setupStore1352751623
numNetworkReqs41281453330142
BrowserifyPower User HomeuiStartup19071535273827319922565
load98187714861329691372
domContentLoaded96987314791329551345
domInteractive36172343930146
firstPaint57410314333909331353
backgroundConnect22019625011228243
firstReactRender85431461994126
getState16612625831185230
initialActions105112
loadScripts76567212641327501146
setupStore201049102447
numNetworkReqs102672915797271
WebpackStandard HomeuiStartup89975812871119261178
load66458094485703868
domContentLoaded65957593985699862
domInteractive2815140242395
firstPaint22299883162214652
backgroundConnect1053651119
firstReactRender42231252445107
getState52181292768114
initialActions107113
loadScripts65657393083697853
setupStore17764111845
numNetworkReqs41281463430144
WebpackPower User HomeuiStartup16411105233624318132040
load66658599298669926
domContentLoaded65657798498658921
domInteractive34171402932113
firstPaint27184990184285667
backgroundConnect1674891839
firstReactRender85471161593105
getState15012419515156178
initialActions102112
loadScripts65357697496656910
setupStore21951122648
numNetworkReqs1596841580199391
FirefoxBrowserifyStandard HomeuiStartup13541181228717813791700
load1054940201313110751279
domContentLoaded1052935201313210711279
domInteractive53301362969127
firstPaint------
backgroundConnect56242774354163
firstReactRender26175493247
getState249189192340
initialActions213123
loadScripts1030893198112710601243
setupStore2510211272158
numNetworkReqs39281242634116
BrowserifyPower User HomeuiStartup24361953334825826082900
load1113917170915611271496
domContentLoaded1112911170815611271496
domInteractive12132486101112404
firstPaint------
backgroundConnect1032840170130301
firstReactRender84381361997115
getState28942890232449787
initialActions208227
loadScripts1078900167215310941475
setupStore1137788145107476
numNetworkReqs1006330854103241
WebpackStandard HomeuiStartup15631386206813615981922
load1261111815909213191412
domContentLoaded1260111815899213181412
domInteractive60271993580129
firstPaint------
backgroundConnect55202193360126
firstReactRender31215773549
getState258236252455
initialActions204122
loadScripts1237110415238712941387
setupStore2310157202169
numNetworkReqs39281262632119
WebpackPower User HomeuiStartup26422207337125027883082
load13371109193415714001665
domContentLoaded13361108193415714001665
domInteractive1072954793103345
firstPaint------
backgroundConnect1123643270129255
firstReactRender82392072191115
getState26168936225376817
initialActions4081937
loadScripts13021090190315413531636
setupStore1436773194111677
numNetworkReqs99592705582240
📊 Page Load Benchmark Results

Current Commit: ca6ffaf | Date: 11/25/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±36ms) 🟢 | historical mean value: 725ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±13ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.01s 1.32s 1.07s 1.32s
domContentLoaded 724ms 36ms 703ms 984ms 750ms 984ms
firstPaint 78ms 13ms 60ms 196ms 88ms 196ms
firstContentfulPaint 78ms 13ms 60ms 196ms 88ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 354 Bytes (0.01%)
  • ui: -53 Bytes (0%)
  • common: 129 Bytes (0%)

@jpuri jpuri added this pull request to the merge queue Nov 25, 2025
Merged via the queue into main with commit de86f7d Nov 25, 2025
333 of 335 checks passed
@jpuri jpuri deleted the dapp_swap_req_fix branch November 25, 2025 12:02
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2025
@metamaskbot metamaskbot added the release-13.12.0 Issue or pull request that will be included in release 13.12.0 label Nov 25, 2025
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.12.0 Issue or pull request that will be included in release 13.12.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quote request should only be triggered for correct requests

5 participants