metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

fix: fixed subscription_state value for Subscription Request Metrics

Open lwin-kyaw opened this issue 1 month ago • 1 comments

Description

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fixed shield subscription request metrics

Related issues

Fixes: https://github.com/MetaMask/metamask-extension/issues/38728

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] Replaces subscription_state with a new enum (new|renew) and updates metrics logic and UI types to use it.

  • Shared constants:
    • Add ShieldSubscriptionRequestSubscriptionStateEnum with new and renew.
  • Shield metrics (shared/modules/shield/metrics.ts):
    • Update getLatestSubscriptionStatus to return ShieldSubscriptionRequestSubscriptionStateEnum (renew if any prior/current subscription, else new).
    • Wire subscription_state in tracking props to the new enum.
  • UI types (ui/hooks/shield/metrics/types.ts):
    • Change CaptureShieldSubscriptionRequestParams.subscriptionState to ShieldSubscriptionRequestSubscriptionStateEnum.

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

lwin-kyaw avatar Dec 10 '25 17:12 lwin-kyaw

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.

github-actions[bot] avatar Dec 10 '25 17:12 github-actions[bot]

Builds ready [dd88357]
UI Startup Metrics (1276 ± 101 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12761055158210113481448
load103986913108510831181
domContentLoaded103286313038510761173
domInteractive2616126222294
firstPaint53194132341110251184
backgroundConnect21619725411224240
firstReactRender4030122114164
getState3518120183881
initialActions104112
loadScripts823661107582858969
setupStore1072131117
numNetworkReqs1367919669
BrowserifyPower User HomeuiStartup19091554232516019902230
load1074880138312811921291
domContentLoaded1064875137112811761281
domInteractive3117132242896
firstPaint608105140342510221245
backgroundConnect254202800107230562
firstReactRender47367454956
getState19314575464205250
initialActions102112
loadScripts85367811491259691066
setupStore1664781436
numNetworkReqs71571482067132
WebpackStandard HomeuiStartup802673110674843945
load64657381265686785
domContentLoaded64056780665681779
domInteractive2714109232296
firstPaint24982784178239686
backgroundConnect1163361329
firstReactRender50321322461120
getState291462113949
initialActions105113
loadScripts63756479864679770
setupStore1253561327
numNetworkReqs1368420670
WebpackPower User HomeuiStartup14641110196218916051774
load757603996108860920
domContentLoaded748597984107850910
domInteractive32161472627103
firstPaint27491828193296749
backgroundConnect87962917726559
firstReactRender50419885263
getState19714037349233313
initialActions103112
loadScripts745594981106846904
setupStore187108131839
numNetworkReqs70571442166131
FirefoxBrowserifyStandard HomeuiStartup13611132193615614321618
load108894313138511401247
domContentLoaded108894013128511401247
domInteractive71341883592138
firstPaint------
backgroundConnect55242293969152
firstReactRender40316794362
getState1163451024
initialActions103122
loadScripts105792712327411121199
setupStore206254351381
numNetworkReqs1568021775
BrowserifyPower User HomeuiStartup26451608395852230323356
load16511000257545320602220
domContentLoaded16511000257545320602220
domInteractive193311172308152983
firstPaint------
backgroundConnect200261127229210928
firstReactRender5437118135984
getState1356597695154197
initialActions3138527
loadScripts1568955246344119792191
setupStore554106714945200
numNetworkReqs74571392274125
WebpackStandard HomeuiStartup15721326222716316511902
load12931136164710613261539
domContentLoaded12931136164610613261538
domInteractive853029042114149
firstPaint------
backgroundConnect59201653878141
firstReactRender42349374552
getState167121201543
initialActions103122
loadScripts1264110716259613031462
setupStore196187231668
numNetworkReqs1668922880
WebpackPower User HomeuiStartup27841824387654132223625
load19081183284552323652687
domContentLoaded19071182284552323642687
domInteractive264311024362250994
firstPaint------
backgroundConnect149271036165201296
firstReactRender6141108156797
getState1347030752157253
initialActions208124
loadScripts18411155282150522872621
setupStore3143744734107
numNetworkReqs75561352467127
📊 Page Load Benchmark Results

Current Commit: dd88357 | Date: 12/10/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.02s (±46ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 715ms (±59ms) 🟢 | historical mean value: 717ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 86ms (±125ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.02s 46ms 1.00s 1.42s 1.04s 1.42s
domContentLoaded 715ms 59ms 696ms 1.26s 730ms 1.26s
firstPaint 86ms 125ms 56ms 1.33s 80ms 1.33s
firstContentfulPaint 86ms 125ms 56ms 1.33s 80ms 1.33s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 206 Bytes (0%)

metamaskbot avatar Dec 10 '25 18:12 metamaskbot

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (4 files, +18 -9)
  • 📁 shared/
    • 📁 lib/
      • 📄 shield.ts +2 -2
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 shield-entry-modal/
          • 📄 shield-entry-modal.tsx +5 -2
    • 📁 hooks/
      • 📁 subscription/
        • 📄 useSubscription.ts +10 -5
    • 📁 pages/
      • 📁 shield-plan/
        • 📄 shield-plan.tsx +1 -0

metamaskbot avatar Dec 11 '25 06:12 metamaskbot

Builds ready [6ba6227]
UI Startup Metrics (1266 ± 110 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12661019161811013301492
load103485913159310831191
domContentLoaded102885213119210771185
domInteractive2616100202286
firstPaint49976125139210031129
backgroundConnect21319424412218238
firstReactRender483179135675
getState3716138194258
initialActions1011213
loadScripts822656108489869967
setupStore1278281320
numNetworkReqs1367919670
BrowserifyPower User HomeuiStartup19191546244815620042201
load1096876153013611871358
domContentLoaded1086869152213511811336
domInteractive3117132242792
firstPaint607133156445510671350
backgroundConnect25220062995235587
firstReactRender47397454856
getState20714473095206278
initialActions103112
loadScripts87167512821339611128
setupStore1473761433
numNetworkReqs71581321969128
WebpackStandard HomeuiStartup8186711151928601021
load65456286075712803
domContentLoaded64855785374706794
domInteractive2614103192378
firstPaint27077772189270706
backgroundConnect125116121429
firstReactRender54332123161128
getState281365133560
initialActions104113
loadScripts64555285073703785
setupStore1264161428
numNetworkReqs1468321678
WebpackPower User HomeuiStartup13931052206020715731742
load708566106899790882
domContentLoaded702560106098774872
domInteractive30171352426104
firstPaint322751073241321858
backgroundConnect74863313684566
firstReactRender50407465359
getState19714764957209273
initialActions102012
loadScripts699558105197772870
setupStore16950101437
numNetworkReqs71562242767143
FirefoxBrowserifyStandard HomeuiStartup14381118250822715191872
load1132941214315011831277
domContentLoaded1131941214315011821277
domInteractive69321853688140
firstPaint------
backgroundConnect62222925276203
firstReactRender42318094464
getState247812841337
initialActions102122
loadScripts1101923205314411541241
setupStore155120171252
numNetworkReqs1568020875
BrowserifyPower User HomeuiStartup26111573460759430773500
load1634945273051120882418
domContentLoaded1634945273051120872418
domInteractive18231105229699983
firstPaint------
backgroundConnect180191084206206885
firstReactRender5333184175777
getState149631034105164293
initialActions2032323
loadScripts1569928258448419992316
setupStore544101912149240
numNetworkReqs75571342280127
WebpackStandard HomeuiStartup15811328216517616542018
load13001109170510913551495
domContentLoaded12991109170510913551495
domInteractive69281413492131
firstPaint------
backgroundConnect58212394062139
firstReactRender4333106104456
getState157146181340
initialActions103122
loadScripts12721089158810113321450
setupStore2162043314106
numNetworkReqs1568120873
WebpackPower User HomeuiStartup27091661476660631103847
load18351115369756923192834
domContentLoaded18341114369656923192834
domInteractive2322911063461741007
firstPaint------
backgroundConnect1992711202802051002
firstReactRender5536218205888
getState1327347660162240
initialActions311361423
loadScripts17371094352152422042640
setupStore494102912337289
numNetworkReqs75551382182130
📊 Page Load Benchmark Results

Current Commit: 6ba6227 | Date: 12/11/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±41ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 723ms (±38ms) 🟢 | historical mean value: 719ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±14ms) 🟢 | historical mean value: 76ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 41ms 1.01s 1.35s 1.07s 1.35s
domContentLoaded 723ms 38ms 697ms 1.02s 751ms 1.02s
firstPaint 77ms 14ms 60ms 204ms 88ms 204ms
firstContentfulPaint 77ms 14ms 60ms 204ms 88ms 204ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -153.48 KiB (-2.91%)
  • ui: 3.8 KiB (0.05%)
  • common: 2.04 KiB (0.02%)

metamaskbot avatar Dec 11 '25 07:12 metamaskbot

Builds ready [94e6ad0]
UI Startup Metrics (1276 ± 96 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1276105715129613351443
load105187113008611071195
domContentLoaded104486412818511011182
domInteractive2615101202282
firstPaint54589123142010521148
backgroundConnect22119826013227247
firstReactRender483197155381
getState3918110174775
initialActions107114
loadScripts830655106682879968
setupStore1366171430
numNetworkReqs1367418667
BrowserifyPower User HomeuiStartup19511593263817320432330
load1117918142312012111349
domContentLoaded1105909141512011891342
domInteractive3318127242999
firstPaint5229414384029791249
backgroundConnect24920861875247523
firstReactRender49426255359
getState21615675396220316
initialActions102112
loadScripts88770411721169701122
setupStore16116581535
numNetworkReqs71591401869125
WebpackStandard HomeuiStartup809669103687864990
load65256684474719797
domContentLoaded64756084073714790
domInteractive2515112192175
firstPaint25381839184231707
backgroundConnect13696141329
firstReactRender4731202235189
getState291371123951
initialActions102112
loadScripts64455883872704788
setupStore1153861226
numNetworkReqs1368019672
WebpackPower User HomeuiStartup14211090195819216151721
load7445931011104847919
domContentLoaded7365881003103841907
domInteractive3016113222698
firstPaint29993913222289856
backgroundConnect86864216184569
firstReactRender49407965062
getState20614271195217332
initialActions104111
loadScripts733586995103835904
setupStore1474671433
numNetworkReqs71572162466127
FirefoxBrowserifyStandard HomeuiStartup13141063223422214201763
load1049902182412611091234
domContentLoaded1048897182412611081234
domInteractive59272474081127
firstPaint------
backgroundConnect53183214967179
firstReactRender393071104463
getState156171221039
initialActions504374312
loadScripts1020887180211810811200
setupStore166175231163
numNetworkReqs1568521876
BrowserifyPower User HomeuiStartup26271636378754030433265
load1651965268449920702348
domContentLoaded1651962268349920702348
domInteractive1023097216475367
firstPaint------
backgroundConnect190231270209243578
firstReactRender5737175186093
getState1285826544159216
initialActions3039526
loadScripts1561949248745919542244
setupStore534108312645287
numNetworkReqs74531221889114
WebpackStandard HomeuiStartup15361302212415615901892
load1268112416059513191469
domContentLoaded1268111916059513191469
domInteractive75281413388132
firstPaint------
backgroundConnect56192003964142
firstReactRender41328784552
getState157190231339
initialActions103123
loadScripts1237110115808912861436
setupStore175271321141
numNetworkReqs1568821875
WebpackPower User HomeuiStartup26091707414753429773519
load18381147336449622862570
domContentLoaded18381147336449622852570
domInteractive2302911383421701006
firstPaint------
backgroundConnect170251078225192958
firstReactRender5436127145885
getState1287235749160222
initialActions3040627
loadScripts17531121257645522112458
setupStore3042724626169
numNetworkReqs74561332280129
📊 Page Load Benchmark Results

Current Commit: 94e6ad0 | Date: 12/11/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±41ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±38ms) 🟢 | historical mean value: 724ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±11ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 41ms 1.02s 1.35s 1.08s 1.35s
domContentLoaded 732ms 38ms 706ms 1.01s 761ms 1.01s
firstPaint 78ms 11ms 60ms 168ms 88ms 168ms
firstContentfulPaint 78ms 11ms 60ms 168ms 88ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -153.46 KiB (-2.91%)
  • ui: 3.8 KiB (0.05%)
  • common: 2.04 KiB (0.02%)

metamaskbot avatar Dec 11 '25 09:12 metamaskbot