fix: clean up spammy Migration 164 Sentry logging#40405
fix: clean up spammy Migration 164 Sentry logging#40405Prithpal-Sooriya merged 3 commits intomainfrom
Conversation
… 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 Agent can help with this pull request. Just |
|
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. |
Builds ready [5702af9]
⚡ Performance Benchmarks (1360 ± 103 ms)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
|
@cursor READ AND FOLLOW THESE MEMORY FILES: Please fix the related unit tests 🙏🏾 |
|
I've fixed the unit tests and pushed the changes. Changes made to
This follows the pattern established in migration 166's tests and ensures:
|
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>
Builds ready [8f96557]
⚡ Performance Benchmarks (1375 ± 108 ms)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
|
Builds ready [dbc7605]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|






Description
Replace Sentry logging with
console.warnfor "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.warnis used for such scenarios.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
Note
Low Risk
Low risk: changes only error-reporting behavior in migration
164for expected “controller missing” states, with updated unit tests to assert the new warnings.Overview
Migration
164no longer reports to Sentry whenPermissionControllerorNetworkControlleris absent; it now emits aconsole.warnand returns the state unchanged.The
164migration tests were updated to set up/tear downglobal.sentryand to assert the expectedconsole.warnmessages 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.