-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: Signature methods failing silently when the wallet is locked and the user is opted in to MetaMetrics #36963
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
Open
jiexi
wants to merge
9
commits into
main
Choose a base branch
from
jl/fix-signature-methods-failing-silently-when-locked-and-metrics-enabled
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+355
−125
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…en-locked-and-metrics-enabled
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. |
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (2 files, +264 -125)
👨🔧 @MetaMask/wallet-integrations (1 files, +14 -0)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [23d5d8e]
UI Startup Metrics (1258 ± 61 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…en-locked-and-metrics-enabled
…en-locked-and-metrics-enabled
…-silently-when-locked-and-metrics-enabled' into jl/fix-signature-methods-failing-silently-when-locked-and-metrics-enabled
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [98eb1c5]
UI Startup Metrics (1230 ± 64 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes a bug where the wallet would not prompt the user for unlock and would silently drop
personal_sign
requests when the wallet was locked and the user was opted into MetaMetrics.This was caused by the KeyringController throwing when trying to resolve account and hardware info in the RPCTrackingMiddleware when receiving a request that maps to a SignatureRequested event. The fix is was to:
Changelog
CHANGELOG entry: Fixed a bug where the wallet would not prompt the user for unlock and would silently drop
personal_sign
requests when the wallet was locked and the user was opted into MetaMetricsRelated issues
Fixes: https://consensys.slack.com/archives/C8RSKCNCD/p1760586496588449
Manual testing steps
await window.ethereum.request({method: 'personal_sign', params: ['message', window.ethereum.selectedAddress]})
Screenshots/Recordings
Before
Screen.Recording.2025-10-17.at.12.02.28.PM.mov
After
Screen.Recording.2025-10-17.at.11.56.48.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Ensure signature tracking doesn’t fail when the wallet is locked by skipping hardware/account lookups until unlocked, retrying on approval/rejection, and expanding tests and messenger permissions.
Approved
/Rejected
) and merges intoeventProperties
.app/scripts/lib/snap-keyring/metrics.ts
):KeyringController:getState
usage; only resolvesaccount_type
,device_model
, andaccount_hardware_type
when wallet is unlocked.KeyringController:getState
.app/scripts/metamask-controller.js
):KeyringController:getState
toSnapAndHardwareMessenger
used by RPC tracking middleware.SignatureRequested
, and retried onSignatureApproved
/SignatureRejected
.metrics.test.ts
with locked/unlocked and HD/Snap account scenarios, and call-order expectations.Written by Cursor Bugbot for commit 98eb1c5. This will update automatically on new commits. Configure here.