Repository navigation
fix(accounts): show JSON import password errors under the password field - #47802
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (5 files, +221 -3)
|
Builds ready [36fc439]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 1 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort 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.
Reviewed by Cursor Bugbot for commit 8d705ec. Configure here.
Builds ready [8d705ec]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 2 warn · 🔴 4 fail)
Bundle Size Diffs
|
Builds ready [13d651c]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 1 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
|




Description
When a JSON keystore import fails because the password is missing or wrong, the error was shown under the JSON file picker. The password field is where the user needs to act, so the error now appears under the password field.
The keystore decrypt step (
ethereumjs-wallet) throws the sameKey derivation failed - possibly wrong passphraseerror for a missing password and a wrong password, so the message is shown as "The password is missing or incorrect." That message is only applied to JSON imports. Private key imports keep their existing error placement.File errors, such as a file that is not a keystore, still appear under the file picker.
No functional change to how imports are performed. This only changes where and how the error is shown.
Changelog
CHANGELOG entry: Fixed JSON account import showing a wrong-password error under the file picker instead of the password field
Related issues
Fixes:
Manual testing steps
test/e2e/import-utc-json/test-json-import-account-file.jsonfrom the repo.wrongpasswordin the password field and click Import.foobarbazquxand click Import. Verify the account imports.Screenshots/Recordings
Before
After
Screen.Recording.2026-11-10.at.7.57.56.PM.mov
Screen.Recording.2026-11-12.at.3.23.34.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
UI-only error placement and messaging for JSON import; no change to import logic beyond how passphrase failures are interpreted for display.
Overview
JSON keystore import errors about missing or wrong passwords are now routed to the password field instead of the file picker, with clearer copy depending on whether the user left the password blank, entered one on the first try, or retried after a blank failure.
The import flow tracks blank-password failures for JSON imports when the backend reports a generic passphrase/MAC error, and
JsonImportViewsplits password vs file validation messages with appropriaterole="alert"/aria-describedbywiring. Non-password JSON errors stay on the file control; private-key import errors keep their existing placement but gain alert semantics on the field help text.New locale strings and unit tests cover the password messaging and accessibility behavior.
Reviewed by Cursor Bugbot for commit 13d651c. Bugbot is set up for automated code reviews on this repo. Configure here.