Skip to content

Conversation

@mikesposito
Copy link
Member

@mikesposito mikesposito commented Dec 4, 2025

Description

The PR adds an additional check to the assertUserOptedIn function passed to the ProfileMetricsController to ensure that profile metrics are only collected after the user has acknowledged the PNA25 notice.

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

Gates profile metrics collection behind pna25Acknowledged and updates E2E tests to cover acknowledgment and other gating conditions.

  • Controller init:
    • Update assertUserOptedIn in app/scripts/controller-init/profile-metrics-controller-init.ts to also require AppStateController.state.pna25Acknowledged === true alongside the feature flag and MetaMetrics opt-in.
  • E2E tests (test/e2e/tests/profile-metrics/profile-metrics.spec.ts):
    • Positive path: include .withAppStateController({ pna25Acknowledged: true }) when MetaMetrics is enabled and the feature flag is on; verify existing and new accounts trigger API calls.
    • Negative paths: parameterize cases to assert no API calls when MetaMetrics is disabled, the feature flag is off, or the user has not acknowledged the privacy change.

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

@metamaskbot metamaskbot added the team-core-platform Core Platform team label Dec 4, 2025
@github-actions github-actions bot added the size-M label Dec 4, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [b5c6270]
UI Startup Metrics (1242 ± 103 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12421035155210313121415
load103786413228810971187
domContentLoaded103185913138810861179
domInteractive2716113212288
firstPaint50181125439310021134
backgroundConnect21819625913226247
firstReactRender3219135153657
getState40161202246105
initialActions1010112
loadScripts819653109985875977
setupStore1162441319
numNetworkReqs1157518565
BrowserifyPower User HomeuiStartup20161643257219321132385
load1026900139912210311355
domContentLoaded1013891138912310231333
domInteractive3417131223589
firstPaint51512114033899461320
backgroundConnect24219972077237336
firstReactRender543895105674
getState19413371960205250
initialActions106112
loadScripts80169411411158081108
setupStore19104772236
numNetworkReqs1436627957201248
WebpackStandard HomeuiStartup810693113372849952
load62556679760648778
domContentLoaded62156279259643772
domInteractive2715120222289
firstPaint20686779146189652
backgroundConnect1055661221
firstReactRender28204563238
getState271471103442
initialActions103112
loadScripts61856078458641763
setupStore1163441319
numNetworkReqs1056716561
WebpackPower User HomeuiStartup16221231219921617422071
load6925841291105704931
domContentLoaded6815771260105696921
domInteractive38182843733105
firstPaint265941290195251669
backgroundConnect68864315419587
firstReactRender60458086775
getState18513677062190219
initialActions103112
loadScripts6795751251103693912
setupStore211059112247
numNetworkReqs1636940769215295
FirefoxBrowserifyStandard HomeuiStartup13471089175415714641637
load1111943145011111671340
domContentLoaded1110943145011111671340
domInteractive70313124890140
firstPaint------
backgroundConnect49221663264119
firstReactRender23185362436
getState146176211132
initialActions103122
loadScripts1082928141110211321290
setupStore136119151134
numNetworkReqs1156216659
BrowserifyPower User HomeuiStartup26491896485356527084125
load1251995289635812272361
domContentLoaded1250995289635812272361
domInteractive1183450289117343
firstPaint------
backgroundConnect151301142197138623
firstReactRender5935138186397
getState28057884206378767
initialActions2036426
loadScripts1213975285733711842219
setupStore1247730157137628
numNetworkReqs83622192978157
WebpackStandard HomeuiStartup14961305194712915481745
load1239109814448612971405
domContentLoaded1239109814448612971405
domInteractive65311413287126
firstPaint------
backgroundConnect4621172245397
firstReactRender28197793051
getState145164191336
initialActions113122
loadScripts1212108114118112701359
setupStore13691141037
numNetworkReqs1256817764
WebpackPower User HomeuiStartup29862240498874328834865
load14841182311644814752896
domContentLoaded14831182311644814752895
domInteractive121301052128108377
firstPaint------
backgroundConnect2123012962981701132
firstReactRender65411502264132
getState29678881224437806
initialActions217123
loadScripts13921159295030514271845
setupStore16871265227159740
numNetworkReqs82471782679144
📊 Page Load Benchmark Results

Current Commit: b5c6270 | Date: 12/4/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 970ms (±40ms) 🟢 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 674ms (±36ms) 🟢 | historical mean value: 733ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 75ms (±10ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 970ms 40ms 947ms 1.26s 991ms 1.26s
domContentLoaded 674ms 36ms 653ms 924ms 692ms 924ms
firstPaint 75ms 10ms 60ms 164ms 84ms 164ms
firstContentfulPaint 75ms 10ms 60ms 164ms 84ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 116 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 20 Bytes (0%)

MajorLift

This comment was marked as outdated.

Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [1424dce]
UI Startup Metrics (1224 ± 97 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1224102816079712891385
load102485313498710751183
domContentLoaded101985013458610691177
domInteractive2615139222184
firstPaint4788312163919961160
backgroundConnect21219526812216235
firstReactRender29196293349
getState3616121183970
initialActions104113
loadScripts812649109283860967
setupStore1172531219
numNetworkReqs1156917559
BrowserifyPower User HomeuiStartup22121681303922223352642
load1113834160114211441518
domContentLoaded1096824159314311181507
domInteractive37181672639113
firstPaint732123152741810931259
backgroundConnect29518967195294561
firstReactRender6342118147088
getState21415132031230275
initialActions104112
loadScripts84364613001318531225
setupStore2085382235
numNetworkReqs1466530061203266
WebpackStandard HomeuiStartup796688101972826978
load61955886165629782
domContentLoaded61555485765626775
domInteractive2715129252197
firstPaint231104834170211619
backgroundConnect1066781128
firstReactRender27207973137
getState271358103544
initialActions104112
loadScripts61255184963624767
setupStore1063141218
numNetworkReqs1157117562
WebpackPower User HomeuiStartup15511252212620315832029
load675583113392682893
domContentLoaded664578112293669880
domInteractive38182193535114
firstPaint26888904183269670
backgroundConnect52756312719534
firstReactRender57438586272
getState17313322819183210
initialActions102112
loadScripts661576108589667870
setupStore20960112249
numNetworkReqs1626940867217286
FirefoxBrowserifyStandard HomeuiStartup13491078178614014321578
load1114926146810011611284
domContentLoaded1113925146810011611284
domInteractive63311332986127
firstPaint------
backgroundConnect49212413653150
firstReactRender23185162336
getState156192261032
initialActions106112
loadScripts108390414399711241257
setupStore1154481030
numNetworkReqs1256517662
BrowserifyPower User HomeuiStartup27222025520859528214189
load1253977262229313471927
domContentLoaded1252977262229313471927
domInteractive1233262097129358
firstPaint------
backgroundConnect156281194217131707
firstReactRender6337283286592
getState301601110249363901
initialActions2029323
loadScripts1185953195019013101516
setupStore16511854199163654
numNetworkReqs84632362782145
WebpackStandard HomeuiStartup15731299215415616421933
load1275110015449913381467
domContentLoaded1275109915449913371467
domInteractive71281943788146
firstPaint------
backgroundConnect55211763470121
firstReactRender3020103103342
getState187179301380
initialActions103122
loadScripts1242104914619213051416
setupStore176140201558
numNetworkReqs1256717765
WebpackPower User HomeuiStartup29872105582782428904836
load15111123318645315212703
domContentLoaded15101123318545315212703
domInteractive1133148497105377
firstPaint------
backgroundConnect174291215220164628
firstReactRender66413043863147
getState286581059229384788
initialActions207123
loadScripts14451093300939714782563
setupStore17371159236164746
numNetworkReqs83601732579143
📊 Page Load Benchmark Results

Current Commit: 1424dce | Date: 12/4/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±40ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±37ms) 🟢 | historical mean value: 730ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 79ms (±13ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 40ms 1.02s 1.33s 1.07s 1.33s
domContentLoaded 729ms 37ms 699ms 992ms 756ms 992ms
firstPaint 79ms 13ms 60ms 196ms 88ms 196ms
firstContentfulPaint 79ms 13ms 60ms 196ms 88ms 196ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 116 Bytes (0%)
  • ui: -7 Bytes (0%)
  • common: 735 Bytes (0.01%)

@mikesposito mikesposito changed the title refactor: gate ProfileMetricsController with pna25Acknowledged refactor: cp-13.13.0 gate ProfileMetricsController with pna25Acknowledged Dec 5, 2025
@mikesposito mikesposito enabled auto-merge December 5, 2025 13:26
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@mikesposito mikesposito added this pull request to the merge queue Dec 5, 2025
Merged via the queue into main with commit b7afe24 Dec 5, 2025
336 of 338 checks passed
@mikesposito mikesposito deleted the mikesposito/refactor/gate-profile-metrics-on-ack branch December 5, 2025 15:04
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2025
@metamaskbot metamaskbot added the release-13.14.0 Issue or pull request that will be included in release 13.14.0 label Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.14.0 Issue or pull request that will be included in release 13.14.0 size-M team-core-platform Core Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants