-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix: handle keyring remove when import srp seedless error cp-13.0.0 #34403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Error Masking During Cleanup
The error handling logic masks the original error if the removeAccount cleanup operation fails. In the try...catch blocks for addNewSeedPhraseBackup and addNewPrivateKeyBackup, if removeAccount throws an error during cleanup, it overwrites the original error, making debugging difficult.
app/scripts/metamask-controller.js#L5136-L5142
metamask-extension/app/scripts/metamask-controller.js
Lines 5136 to 5142 in 008b2e4
| ); | |
| } catch (err) { | |
| // handle seedless controller import error by reverting keyring controller mnemonic import | |
| // KeyringController.removeAccount will remove keyring when it's emptied, currently there are no other method in keyring controller to remove keyring | |
| await this.keyringController.removeAccount(newAccountAddress); | |
| throw err; | |
| } |
app/scripts/metamask-controller.js#L6393-L6399
metamask-extension/app/scripts/metamask-controller.js
Lines 6393 to 6399 in 008b2e4
| ); | |
| } catch (err) { | |
| // handle seedless controller import error by reverting keyring controller mnemonic import | |
| // KeyringController.removeAccount will remove keyring when it's emptied, currently there are no other method in keyring controller to remove keyring | |
| await this.keyringController.removeAccount(importedAccountAddress); | |
| throw err; | |
| } |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Builds ready [008b2e4]
UI Startup Metrics (1297 ± 63 ms)
Benchmark value 1109 exceeds gate value 1070 for chrome browserify home mean load Benchmark value 1101 exceeds gate value 1061 for chrome browserify home mean domContentLoaded Benchmark value 216 exceeds gate value 10 for chrome browserify home mean backgroundConnect Benchmark value 3 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 892 exceeds gate value 830 for chrome browserify home mean loadScripts Benchmark value 1432 exceeds gate value 1365 for chrome browserify home p95 uiStartup Benchmark value 1200 exceeds gate value 1190 for chrome browserify home p95 load Benchmark value 1195 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded Benchmark value 42 exceeds gate value 41 for chrome browserify home p95 domInteractive Benchmark value 1197 exceeds gate value 1180 for chrome browserify home p95 firstPaint Benchmark value 236 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 13 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 978 exceeds gate value 940 for chrome browserify home p95 loadScripts Benchmark value 2381 exceeds gate value 2192 for chrome webpack home mean uiStartup Benchmark value 1879 exceeds gate value 1711 for chrome webpack home mean load Benchmark value 1872 exceeds gate value 1704 for chrome webpack home mean domContentLoaded Benchmark value 9 exceeds gate value 7 for chrome webpack home mean initialActions Benchmark value 1865 exceeds gate value 1699 for chrome webpack home mean loadScripts Benchmark value 2566 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 2115 exceeds gate value 2030 for chrome webpack home p95 load Benchmark value 2110 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded Benchmark value 65 exceeds gate value 57 for chrome webpack home p95 domInteractive Benchmark value 343 exceeds gate value 334 for chrome webpack home p95 firstPaint Benchmark value 233 exceeds gate value 90 for chrome webpack home p95 backgroundConnect Benchmark value 16 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 2108 exceeds gate value 1970 for chrome webpack home p95 loadScripts Benchmark value 1489 exceeds gate value 1405 for firefox browserify home mean uiStartup Benchmark value 1284 exceeds gate value 1245 for firefox browserify home mean load Benchmark value 1283 exceeds gate value 1239 for firefox browserify home mean domContentLoaded Benchmark value 117 exceeds gate value 110 for firefox browserify home mean domInteractive Benchmark value 31 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 28 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 9 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 1261 exceeds gate value 1230 for firefox browserify home mean loadScripts Benchmark value 1911 exceeds gate value 1660 for firefox browserify home p95 uiStartup Benchmark value 297 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 58 exceeds gate value 55 for firefox browserify home p95 firstReactRender Benchmark value 36 exceeds gate value 24 for firefox browserify home p95 getState Benchmark value 16 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 1832 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1539 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1538 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 33 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 54 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 12 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 1512 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 19 exceeds gate value 13 for firefox webpack home mean setupStore Benchmark value 2279 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1806 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1806 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 182 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 62 exceeds gate value 49 for firefox webpack home p95 backgroundConnect Benchmark value 62 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 58 exceeds gate value 2 for firefox webpack home p95 initialActions Benchmark value 1784 exceeds gate value 1630 for firefox webpack home p95 loadScripts Benchmark value 73 exceeds gate value 28 for firefox webpack home p95 setupStore Sum of mean exceeds: 2053ms | Sum of p95 exceeds: 2310.8ms Sum of all benchmark exceeds: 4363.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
himanshuchawla009
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
lwin-kyaw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist