Skip to content

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Oct 10, 2025

Description

This PR aims to fix first time interaction alert to check recipient derived from transaction data when sending ERCX tokens. It still checks the to parameter regardless of the changes.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: #35595

Manual testing steps

See task details to repro steps

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

Update first-time interaction alert to check both the transaction to and derived recipient with useTrustSignals, refining loading/verified logic and tests.

  • Confirmations Alerts:
    • Update useFirstTimeInteractionAlert to use useTrustSignals with multiple requests (for txParams.to and derived recipient from useTransferRecipient).
    • Determine alert visibility by requiring no internal account match, isFirstTimeInteraction true, no first-party contract, no loading trust signals, and all addresses not verified.
    • Compute recipient/transactionTo separately; compare internal accounts against the derived recipient; use getExperience on txParams.to.
  • Tests:
    • Refactor mocks to useTrustSignals and return arrays; add to in transaction mocks and set explicit types where needed.
    • Add/adjust cases for verified, loading, internal account, token transfer recipient, and first-party contract scenarios.

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

@OGPoyraz OGPoyraz requested a review from a team as a code owner October 10, 2025 11:28
@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Oct 10, 2025
cursor[bot]

This comment was marked as outdated.

@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (2 files, +68 -50)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 alerts/
            • 📁 transactions/
              • 📄 useFirstTimeInteractionAlert.test.ts +41 -35
              • 📄 useFirstTimeInteractionAlert.ts +27 -15

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 01064ff | Date: 10/10/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±73ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±70ms) 🟢 | historical mean value: 734ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±15ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 73ms 1.01s 1.36s 1.26s 1.36s
domContentLoaded 733ms 70ms 698ms 1.03s 936ms 1.03s
firstPaint 77ms 15ms 56ms 216ms 84ms 216ms
firstContentfulPaint 77ms 15ms 56ms 216ms 84ms 216ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [01064ff]
UI Startup Metrics (1224 ± 72 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1224108014417212671371
load105893712646910921184
domContentLoaded105292912526810861175
domInteractive17134361635
firstPaint71290119142210681143
backgroundConnect2472302798251263
firstReactRender2618209192540
getState1053351119
initialActions40244414
loadScripts810684100366841932
setupStore85263914
WebpackHomeuiStartup813701112168826952
load62858197167633793
domContentLoaded62057395066627787
domInteractive161187121446
firstPaint19554944177194591
backgroundConnect22125172637
firstReactRender27168893134
getState841931013
initialActions207235
loadScripts61757193864625774
setupStore84182912
FirefoxBrowserifyHomeuiStartup1360119717298514051522
load1172104113246412181302
domContentLoaded1172104013246412171302
domInteractive973427039105204
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2819162163041
firstReactRender28234242937
getState63818510
initialActions2016325
loadScripts1152102313046311931283
setupStore64263613
WebpackHomeuiStartup15421317211013615971808
load1329116815759313961537
domContentLoaded1329116815759313961536
domInteractive952935756100198
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3216138183670
firstReactRender352677113771
getState10312720545
initialActions505710235
loadScripts1304115215298913681482
setupStore12413120747

@OGPoyraz OGPoyraz added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Oct 10, 2025
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 526afa2 | Date: 10/10/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±72ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±70ms) 🟢 | historical mean value: 736ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±10ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 72ms 1.00s 1.33s 1.27s 1.33s
domContentLoaded 732ms 70ms 694ms 1.02s 949ms 1.02s
firstPaint 77ms 10ms 64ms 164ms 84ms 164ms
firstContentfulPaint 77ms 10ms 64ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [526afa2]
UI Startup Metrics (1294 ± 76 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1294113016137613381405
load110797513626511441219
domContentLoaded109996813556711371214
domInteractive201380102045
firstPaint63676137445611311222
backgroundConnect26224039919265285
firstReactRender2818162152948
getState1253451423
initialActions617110517
loadScripts844711109264879952
setupStore1052441117
WebpackHomeuiStartup8197011129818251011
load63057697178636859
domContentLoaded62356996377629850
domInteractive15115281336
firstPaint19756899201191607
backgroundConnect21104262431
firstReactRender271669103148
getState83153913
initialActions2012237
loadScripts62056795275627839
setupStore84202913
FirefoxBrowserifyHomeuiStartup13721181195614414341700
load1169102613738512441308
domContentLoaded1169102613738512431307
domInteractive93332905093241
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect27197583238
firstReactRender29245343035
getState739511514
initialActions6020224213
loadScripts1148100913478312221286
setupStore11417823646
WebpackHomeuiStartup15391342195411915661809
load1333119417498713721489
domContentLoaded1333119417498713721489
domInteractive952935549101187
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect36182262935109
firstReactRender342577103660
getState11218726545
initialActions30638214
loadScripts1307117816517913461457
setupStore10312015743
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 125 Bytes (0%)
  • common: 10 Bytes (0%)

state: TrustSignalDisplayState.Verified,
label: null,
},
]);
Copy link

Choose a reason for hiding this comment

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

Bug: Mock Returns Single Signal, Fails Multi-Address Testing

The useTrustSignals mock in tests consistently returns a single trust signal, even though the hook can request signals for multiple addresses (like contract and recipient in token transfers). This prevents accurate testing of multi-address scenarios and conditions that rely on checking all or some trust signals.

Additional Locations (1)

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: a9b8a2b | Date: 10/13/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±70ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±83ms) 🟢 | historical mean value: 738ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±15ms) 🟢 | historical mean value: 77ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 70ms 1.01s 1.31s 1.26s 1.31s
domContentLoaded 733ms 83ms 697ms 1.28s 934ms 1.28s
firstPaint 76ms 15ms 60ms 208ms 88ms 208ms
firstContentfulPaint 76ms 15ms 60ms 208ms 88ms 208ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [a9b8a2b]
UI Startup Metrics (1213 ± 65 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1213108414206512491351
load104995112496110781170
domContentLoaded104394612416010731165
domInteractive18138991736
firstPaint68788122542110631129
backgroundConnect2492352837253259
firstReactRender24184852538
getState13567111444
initialActions40224413
loadScripts80070599159828908
setupStore95294917
WebpackHomeuiStartup838721114167853962
load63959194359654772
domContentLoaded63058493459638765
domInteractive16126081435
firstPaint19356769163194611
backgroundConnect23115072733
firstReactRender28176183339
getState832031015
initialActions2011237
loadScripts62758192356636753
setupStore841831013
FirefoxBrowserifyHomeuiStartup14081233175711214731637
load1206106615368512671357
domContentLoaded1206106615368512661357
domInteractive983529049103229
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect292086113247
firstReactRender30256453239
getState73749520
initialActions30204213
loadScripts1184104715178312421328
setupStore10413616731
WebpackHomeuiStartup15811350216213416251852
load1371120416248614091537
domContentLoaded1370120416238614081536
domInteractive1012538668103281
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3318108153668
firstReactRender362686123778
getState12213524657
initialActions7019724226
loadScripts1346118915818413891517
setupStore945910743
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 125 Bytes (0%)
  • common: 10 Bytes (0%)

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

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 'First time interacting with' warning only appears on native assets in simple send flow

2 participants