-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
fix: Avoid nonce flicker when transaction is submitted #30193
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 [26c8bf0]
Page Load Metrics (1736 ± 59 ms)
Bundle size diffs
|
@@ -219,8 +217,6 @@ const Footer = () => { | |||
} else { | |||
dispatch(resolvePendingApproval(currentConfirmation.id, undefined)); | |||
} | |||
dispatch(updateCustomNonce('')); | |||
dispatch(setNextNonce('')); |
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.
These calls were added here as it at times resulted in confirmation using old nonce when switching networks. Can you plz check if removing this does not re-introduce that bug.
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.
After discussing this with @jpuri, she informed me that there used to be a bug in the legacy confirmations that:
- if you created confirmation on a network
- edit the nonce
- and then switch to another network
- the confirmation page now would show old nonce.
Thus we added this code to clear the old nonce value after confirmation was submitted.
I tested this scenario a few times and it seems to not be an issue in the new confirmations even when removing this code. I will ask our QA engineer to double check this for us.
41dc786
to
b991cd3
Compare
Builds ready [b991cd3]
Page Load Metrics (1689 ± 102 ms)
Bundle size diffs
|
No flickering in Chrome and Firefox: Screen.Recording.2025-02-11.at.11.17.27.movScreen.Recording.2025-02-11.at.11.24.47.mov |
Description
Submitting or cancelling a transaction was clearing the custom nonce field before the confirmation popup had time to close. This PR fixes that.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4140
Manual testing steps
Screenshots/Recordings
Before
cancel.flicker.mov
nonce.goes.to.zero.on.transaction.mov
After
Pre-merge author checklist
Pre-merge reviewer checklist