Skip to content

fix: clean up spammy Migration 164 Sentry logging#40405

Merged
Prithpal-Sooriya merged 3 commits intomainfrom
cursor/migration-164-sentry-logging-536a
Feb 27, 2026
Merged

fix: clean up spammy Migration 164 Sentry logging#40405
Prithpal-Sooriya merged 3 commits intomainfrom
cursor/migration-164-sentry-logging-536a

Conversation

@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Feb 25, 2026

Description

Replace Sentry logging with console.warn for "controller not found" cases in migration 164.

Missing controllers are expected edge cases (e.g., fresh installs, old states) and should not generate Sentry errors, aligning with the pattern established in other migrations (e.g., 166, 180) where console.warn is used for such scenarios.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: fix: clean up spammy Migration 164 Sentry logging

Related issues

Fixes: #34588 https://consensyssoftware.atlassian.net/browse/ASSETS-2024

Manual testing 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.

Open in Web Open in Cursor 


Note

Low Risk
Low risk: changes only error-reporting behavior in migration 164 for expected “controller missing” states, with updated unit tests to assert the new warnings.

Overview
Migration 164 no longer reports to Sentry when PermissionController or NetworkController is absent; it now emits a console.warn and returns the state unchanged.

The 164 migration tests were updated to set up/tear down global.sentry and to assert the expected console.warn messages for these missing-controller cases (including the version-bump test).

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

… in migration 164

This change addresses Sentry issue METAMASK-XNBE where 'PermissionController not found'
errors were being logged unnecessarily. Missing controllers are expected edge cases
(fresh installs, old state) and should not create Sentry noise.

Following the pattern used in other migrations (166, 180, 182, 183), we now use
console.warn for 'not found' cases while keeping Sentry logging for actual
data corruption issues (type mismatches).

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
@cursor
Copy link
Copy Markdown

cursor bot commented Feb 25, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [5702af9]
⚡ Performance Benchmarks (1360 ± 103 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2655264272
total2655264272
Confirm Txconfirm_tx6053560516061
total6053560516061
Bridge User Actionsbridge_load_page24630271273
bridge_load_asset_picker20357232283
bridge_search_token72016730744
total11696212061249
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13601163172810314161544
load116299515009512001316
domContentLoaded115599114869211971309
domInteractive2817130212479
firstPaint170621180164204343
backgroundConnect20419024912206238
firstReactRender18133432024
initialActions106113
loadScripts96779712929210061122
setupStore1264461422
numNetworkReqs312290192284
Chrome Browserify Startup Power User HomeuiStartup17741369381738317592182
load11251018173412911171446
domContentLoaded11091007164812111031432
domInteractive3218146193451
firstPaint169731671163215270
backgroundConnect3162511064128290573
firstReactRender23155172437
initialActions104112
loadScripts90880914121168971194
setupStore1663971830
numNetworkReqs63391542371117
Chrome Webpack Startup Standard HomeuiStartup86270011341039111085
load741621102897815899
domContentLoaded735617102197809891
domInteractive2815115202475
firstPaint1126334655131210
backgroundConnect27196583141
firstReactRender18123662131
initialActions104112
loadScripts733615101896807881
setupStore1263341319
numNetworkReqs312297202586
Chrome Webpack Startup Power User HomeuiStartup1281983205316713851516
load75566512431087481029
domContentLoaded74565912351087381024
domInteractive3919190293994
firstPaint1456955987168297
backgroundConnect17813736644179275
firstReactRender25184742732
initialActions105112
loadScripts74265712181057361005
setupStore1566391529
numNetworkReqs973924848138175
Firefox Browserify Startup Standard HomeuiStartup16661399312023216762094
load14071180286520914171742
domContentLoaded14061180286020914171742
domInteractive933491510497223
firstPaint------
backgroundConnect61312062759116
firstReactRender14114031416
initialActions102012
loadScripts13771156283720313911687
setupStore187163231550
numNetworkReqs311998192787
Firefox Browserify Startup Power User HomeuiStartup28972066757480930193851
load16771278584866117702438
domContentLoaded16761277584766117692433
domInteractive15034720151131496
firstPaint------
backgroundConnect3131131501297345989
firstReactRender191469101922
initialActions112022
loadScripts16411257580465617122378
setupStore1458963211118642
numNetworkReqs69301723389123
Firefox Webpack Startup Standard HomeuiStartup17761506329427517961969
load14971250285425315091664
domContentLoaded14971249285425415081664
domInteractive133311528205133229
firstPaint------
backgroundConnect65271542672114
firstReactRender17132931726
initialActions103122
loadScripts14711231281925214811638
setupStore228147211955
numNetworkReqs312090172777
Firefox Webpack Startup Power User HomeuiStartup26321921358137128723349
load15011223220423316341983
domContentLoaded15001223220423316341983
domInteractive13331792150120519
firstPaint------
backgroundConnect290105945217310836
firstReactRender21157262328
initialActions207123
loadScripts14711190213722916011937
setupStore17510749210227678
numNetworkReqs70301863890142
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2181218220
srpButtonToSrpForm95397100
confirmSrpToPwForm2202223
pwFormToMetricsScreen1601616
metricsToWalletReadyScreen1701717
doneButtonToHomeScreen102334812961518
openAccountMenuToAccountListLoaded728660976717859
total888115589319051
Onboarding New WalletcreateWalletToSocialScreen2191220220
srpButtonToPwForm1042104106
createPwToRecoveryScreen8088
skipBackupToMetricsScreen3513536
agreeButtonToOnboardingSuccess1601616
doneButtonToAssetList57719600600
total93447961983
Asset DetailsassetClickToPriceChart46165176
total46165176
Solana Asset DetailsassetClickToPriceChart6246566
total6246566
Import Srp HomeloginToHomeScreen220111922882379
openAccountMenuAfterLogin4654554
homeAfterImportWithNewWallet20865821622162
total415119042664363
Send TransactionsopenSendPageFromHome1811819
selectTokenToSendFormLoaded1912020
reviewTransactionToConfirmationPage8483850851
total8929899906
SwapopenSwapPageFromHome11510122127
fetchAndDisplaySwapQuotes45992146054629
total47133147274756
🌐 Dapp Page Load Benchmarks

Current Commit: 5702af9 | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±56ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 734ms (±51ms) 🟢 | historical mean value: 732ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±11ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 56ms 1.01s 1.34s 1.23s 1.34s
domContentLoaded 734ms 51ms 698ms 1.02s 757ms 1.02s
firstPaint 78ms 11ms 64ms 172ms 84ms 172ms
firstContentfulPaint 78ms 11ms 64ms 172ms 84ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: -136 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 156 Bytes (0%)

@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor Author

@cursor READ AND FOLLOW THESE MEMORY FILES:

Please fix the related unit tests 🙏🏾

@cursor
Copy link
Copy Markdown

cursor bot commented Feb 25, 2026

I've fixed the unit tests and pushed the changes.

Changes made to app/scripts/migrations/164.test.ts:

  • Added global.sentry mock setup in beforeEach and cleanup in afterEach
  • Added jest.spyOn(console, 'warn').mockImplementation(jest.fn()) to tests that trigger console warnings
  • Updated test names to reflect they verify warnings are logged (e.g., "logs a warning and returns unchanged state when PermissionController is missing")
  • Added assertions to verify the expected warning messages are called

This follows the pattern established in migration 166's tests and ensures:

  • All 10 tests pass
  • No console baseline violations
  • Proper verification of warning messages

View PR

Open in Web Open in Cursor 

Updated tests to:
- Add global.sentry mock setup/teardown
- Mock console.warn with jest.spyOn to avoid console baseline violations
- Verify expected warning messages are logged

This follows the pattern established in other migration tests (e.g., 166).

Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 25, 2026

Builds ready [8f96557]
⚡ Performance Benchmarks (1375 ± 108 ms)
👆 Interaction Benchmarks
ActionMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account2624262268
total2624262268
Confirm Txconfirm_tx60623460886103
total60623460886103
Bridge User Actionsbridge_load_page1803181184
bridge_load_asset_picker22530250272
bridge_search_token73038770784
total11448312041279
🔌 Startup Benchmarks
BuildMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
Chrome Browserify Startup Standard HomeuiStartup13751143168910814011593
load1157962142510011931381
domContentLoaded1150956141910111881356
domInteractive2817120212483
firstPaint223631372228219354
backgroundConnect20619025212211230
firstReactRender18113642026
initialActions106114
loadScripts96176212231009961160
setupStore1374161524
numNetworkReqs3122105212290
Chrome Browserify Startup Power User HomeuiStartup2445145910689162021084772
load11871033170115812221621
domContentLoaded11731024167715612011596
domInteractive38191552936114
firstPaint1918445591246365
backgroundConnect834257877014504173060
firstReactRender24164462638
initialActions104112
loadScripts96481614591529911372
setupStore1563761728
numNetworkReqs74411532786132
Chrome Webpack Startup Standard HomeuiStartup84568513551098711046
load720612110292770905
domContentLoaded715609109292766895
domInteractive2816121222375
firstPaint1226170289142268
backgroundConnect28196792945
firstReactRender19113972134
initialActions1010112
loadScripts712607108390764888
setupStore1162841220
numNetworkReqs312297212590
Chrome Webpack Startup Power User HomeuiStartup1302998251522813961644
load76164413001127551051
domContentLoaded75063812901137421046
domInteractive41192003437118
firstPaint1426653783159275
backgroundConnect199137930115177347
firstReactRender24173532529
initialActions103011
loadScripts74763612761107401037
setupStore1355961519
numNetworkReqs1164024543141185
Firefox Browserify Startup Standard HomeuiStartup15761358226115215991900
load13271149201313113651544
domContentLoaded13261144201313113621543
domInteractive75335155689136
firstPaint------
backgroundConnect5530176205776
firstReactRender13111711315
initialActions102122
loadScripts12991127198712313411516
setupStore188149231550
numNetworkReqs311998212590
Firefox Browserify Startup Power User HomeuiStartup28382089399644230843745
load16151286276432316522359
domContentLoaded16151286276432316522359
domInteractive166441411189144477
firstPaint------
backgroundConnect3751151292286547956
firstReactRender201569101826
initialActions2037422
loadScripts15721265272831415902313
setupStore1389787173140514
numNetworkReqs74311883794158
Firefox Webpack Startup Standard HomeuiStartup17991450350837417842314
load15151247303131315031876
domContentLoaded15141247303131315031872
domInteractive115301541155134222
firstPaint------
backgroundConnect64282523371117
firstReactRender16132731725
initialActions103122
loadScripts14881220297930914761853
setupStore36913791372066
numNetworkReqs311983162769
Firefox Webpack Startup Power User HomeuiStartup26891892757063828353530
load15391265602050015711944
domContentLoaded15381260601949915701944
domInteractive14231832157129494
firstPaint------
backgroundConnect3991084739527408960
firstReactRender2415211212336
initialActions103122
loadScripts14641237220821115301873
setupStore1478890200125623
numNetworkReqs73331753685144
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2225224231
srpButtonToSrpForm9329396
confirmSrpToPwForm2202223
pwFormToMetricsScreen1501515
metricsToWalletReadyScreen1601616
doneButtonToHomeScreen5787585586
openAccountMenuToAccountListLoaded78642879047904
total88636988668973
Onboarding New WalletcreateWalletToSocialScreen2170218218
srpButtonToPwForm1062107109
createPwToRecoveryScreen9099
skipBackupToMetricsScreen3613737
agreeButtonToOnboardingSuccess1711717
doneButtonToAssetList101428111621442
total139928115491825
Asset DetailsassetClickToPriceChart55187082
total55187082
Solana Asset DetailsassetClickToPriceChart5565766
total5565766
Import Srp HomeloginToHomeScreen22032922342234
openAccountMenuAfterLogin4224445
homeAfterImportWithNewWallet21993022042238
total450925547734801
Send TransactionsopenSendPageFromHome38204271
selectTokenToSendFormLoaded2352631
reviewTransactionToConfirmationPage88434884936
total93525933974
SwapopenSwapPageFromHome1367140145
fetchAndDisplaySwapQuotes525080762186259
total539580263506404
🌐 Dapp Page Load Benchmarks

Current Commit: 8f96557 | Date: 2/25/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±37ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 724ms (±34ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±13ms) 🟢 | historical mean value: 78ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 37ms 1.01s 1.32s 1.07s 1.32s
domContentLoaded 724ms 34ms 699ms 979ms 749ms 979ms
firstPaint 78ms 13ms 60ms 200ms 84ms 200ms
firstContentfulPaint 78ms 13ms 60ms 200ms 84ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: -136 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 156 Bytes (0%)

@Prithpal-Sooriya Prithpal-Sooriya changed the title Migration 164 Sentry logging fix: clean up spammy Migration 164 Sentry logging Feb 26, 2026
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review February 26, 2026 12:25
@sonarqubecloud
Copy link
Copy Markdown

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 bot commented Feb 26, 2026

Builds ready [dbc7605]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29826235133299351
total29826235133299351
Confirm Txconfirm_tx6049601560822460656082
total6049601560822460656082
Bridge User Actionsbridge_load_page22919826824236268
bridge_load_asset_picker23118228033251280
bridge_search_token71970673310724733
total1179112412234412101223
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14301199176710814661637
load1201101714929412351378
domContentLoaded1194100014899412281370
domInteractive2818100172577
firstPaint1477242975208271
backgroundConnect21619837520218241
firstReactRender20134262133
initialActions108113
loadScripts99581212839410251165
setupStore1375871422
numNetworkReqs312291192283
Power User HomeuiStartup3202145410442213939799399
load12271046168111512681462
domContentLoaded12101033164711012541421
domInteractive3419180243265
firstPaint1938441285274333
backgroundConnect13542678181175921964236
firstReactRender25154762737
initialActions105112
loadScripts997822144410910411224
setupStore1553861828
numNetworkReqs80411532290121
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202182253219225
srpButtonToSrpForm98931096100109
confirmSrpToPwForm23212622426
pwFormToMetricsScreen17151811818
metricsToWalletReadyScreen17171701717
doneButtonToHomeScreen930651128522510811285
openAccountMenuToAccountListLoaded75487255784524476937845
total8890887189091689038909
Onboarding New WalletcreateWalletToSocialScreen2212182263223226
srpButtonToPwForm1091071111109111
createPwToRecoveryScreen999099
skipBackupToMetricsScreen35353613636
agreeButtonToOnboardingSuccess17161711717
doneButtonToAssetList6156056216618621
total10059991012510121012
Asset DetailsassetClickToPriceChart543780176980
total543780176980
Solana Asset DetailsassetClickToPriceChart48475014850
total48475014850
Import Srp HomeloginToHomeScreen1946188920134719672013
openAccountMenuAfterLogin46375985059
homeAfterImportWithNewWallet22772111259518123602595
total41874050431610042374316
Send TransactionsopenSendPageFromHome261639103939
selectTokenToSendFormLoaded21212212222
reviewTransactionToConfirmationPage89184998154924981
total9388831022559831022
SwapopenSwapPageFromHome1129712813126128
fetchAndDisplaySwapQuotes53244598640481762356404
total54364712653181963356531
🌐 Dapp Page Load Benchmarks

Current Commit: dbc7605 | Date: 2/26/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±47ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±42ms) 🟢 | historical mean value: 734ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±12ms) 🟢 | historical mean value: 82ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 47ms 1.02s 1.37s 1.05s 1.37s
domContentLoaded 732ms 42ms 712ms 1.02s 742ms 1.02s
firstPaint 80ms 12ms 64ms 192ms 88ms 192ms
firstContentfulPaint 80ms 12ms 64ms 192ms 88ms 192ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: -136 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Feb 27, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2026
@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Feb 27, 2026
@Prithpal-Sooriya Prithpal-Sooriya removed this pull request from the merge queue due to a manual request Feb 27, 2026
@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit 0724b12 Feb 27, 2026
348 of 353 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the cursor/migration-164-sentry-logging-536a branch February 27, 2026 11:39
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2026
@metamaskbot metamaskbot added the release-13.22.0 Issue or pull request that will be included in release 13.22.0 label Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.22.0 Issue or pull request that will be included in release 13.22.0 size-S team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sentry] Error: Migration 164: PermissionController not found.

4 participants