MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.04k stars 1.06k forks source link

fix: fix stuck after `nonce too low` error #10049

Closed OGPoyraz closed 1 week ago

OGPoyraz commented 1 week ago

Description

This PR aims to fix send flow after getting nonce too low error.

Related issues

Fixes: https://github.com/MetaMask/metamask-mobile/issues/9729

Manual testing steps

  1. Go to send flow
  2. Before send, change it to lower nonce to get error
  3. Get error and see it's redirected to the latest screen you're on
  4. Try send flow again
  5. It should successfully send

Screenshots/Recordings

Before

Forwarded from tests https://github.com/MetaMask/metamask-mobile/assets/104780023/655e0a17-0768-422b-a337-7909bc560e84

After

https://github.com/MetaMask/metamask-mobile/assets/7644512/a1265c59-b870-4fab-9b29-a2657cb78008

Pre-merge author checklist

Pre-merge reviewer checklist

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

sleepytanya commented 1 week ago

Bitrise build https://app.bitrise.io/build/998c80b8-fc0a-4193-9cac-229f25a01a01?tab=artifacts Samsung S24+, Android 14

Correct nonce transaction can be successfully send after attempt to send low nonce transaction:

https://github.com/MetaMask/metamask-mobile/assets/104780023/0f3f499c-ba2b-4eb2-be81-e5c97ec4011f

High nonce transaction can be successfully send after attempt to send low nonce transaction:

https://github.com/MetaMask/metamask-mobile/assets/104780023/78b32f13-68a5-4b66-a31a-aa9a43532f0d