fix: handle missing TransactionController in migration 187 gracefully#40765
fix: handle missing TransactionController in migration 187 gracefully#40765cryptotavares merged 2 commits intomainfrom
Conversation
|
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 [8c575fd]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
8c575fd to
9ccca07
Compare
Builds ready [9ccca07]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Users upgrading from older versions may not have a TransactionController in their stored state. Previously this threw an error via Sentry that blocked initialization. Now it logs a console warning and skips the migration, consistent with how missing transactions is already handled. Fixes #39609 https://claude.ai/code/session_01AyphppibFc9iZTRv8JVTVN
9ccca07 to
b87c2b7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| // -- Step 1: Validate TransactionController exists | ||
| // | ||
| if (!hasProperty(state, 'TransactionController')) { | ||
| global.sentry?.captureException?.( |
There was a problem hiding this comment.
Missing console.warn for absent TransactionController case
Low Severity
The PR description states it "logs a console warning and skips the migration, consistent with how missing transactions is already handled," and the test is named "skips migration with warning." However, the missing TransactionController branch at line 34–35 silently returns false without any console.warn. The analogous missing-transactions branch (line 52–56) does call console.warn. The test also doesn't assert that a warning was logged, unlike its counterpart test for missing transactions.
Additional Locations (1)
|
Builds ready [4ed085d]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|





Description
Users upgrading from older extension versions may not have a
TransactionControllerin their stored state. Migration 187 previously threw a Sentry error (Migration 187: state.TransactionController is not defined) when encountering this case, which caused noise in error tracking and could block initialization.This PR removes the
sentry.captureExceptioncall for the missingTransactionControllercase and instead lets the migration skip silently (returningfalse), consistent with how the migration already handles a missingtransactionsproperty. A regression test is added to verify state is left unchanged whenTransactionControlleris absent.Changelog
CHANGELOG entry: Fixed a Sentry error during startup for users upgrading from older versions without TransactionController state
Related issues
Fixes: #39609
Manual testing steps
yarn jest app/scripts/migrations/187.test.tsskips migration with warning if TransactionController is missing from statepassesPre-merge author checklist
Pre-merge reviewer checklist