metamask-extension
metamask-extension copied to clipboard
[Bug]: Attempt to submit another transaction while having transaction in 'Pending' state, Smart Transactions toggle is ON
Describe the bug
I have limited knowledge around Smart Transactions feature and expected behavior so I will just write down steps.
When attempting to initiate a new transaction while another is in a 'Pending' state, with the Smart Transactions feature enabled, a series of chaotic behaviors have been observed:
- A transaction is set to 'Pending' state using low gas for a direct ETH->ETH send (nonce 1579).
- Another direct send ETH->ETH transaction is created.
- A red warning on the confirmation screen indicates 'A previous tx is still being signed or submitted,' and the 'Confirm' button is disabled.
- After rejection and creation of a new transaction (ETH->USDT), the 'Confirm' button becomes available without warnings.
- Clicking 'Confirm' creates 'Unapproved' transaction.
- The user can edit recipient and destination token fields for the 'Unapproved' transaction, but the 'Confirm' button is inactive, and rejection does not function.
- Modifying the 'Unapproved' transaction activates the 'Confirm' button, but clicking it generates another 'Unapproved' transaction.
- I created 1 'Pending' and 3 'Unapproved' transactions. Once the transactions were confirmed, only two Failed transactions can be seen within the Activity tab: nonce 1579 and 1580, marked as ETH->USDC. Popup notifying that the transaction was cancelled was displayed after some time.
- Notice that the popup and Smart Transactions screen are only displayed for the first and for the last transaction.
Related bug: https://github.com/MetaMask/metamask-extension/issues/25356
Expected behavior
Screenshots/Recordings
https://github.com/MetaMask/metamask-extension/assets/104780023/e59a7274-5c17-44cf-b242-004bcbf73e7f
https://github.com/MetaMask/metamask-extension/assets/104780023/5845bbc3-5763-426a-9b24-45ba3adeaa71
Steps to reproduce
- See the description
Error messages or log output
No response
Version
12.0.0
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
Severity
No response
Current behavior
- Banner 'Transaction still pending to be signed or submitted' does not appear after a transaction has been rejected because a stx was still in progress
- Confirm button is enabled after a transaction has been rejected because a stx was still in progress
Expected behavior
- Banner 'Transaction still pending to be signed or submitted' should appear until original (stx) transaction has been submitted. Regardless of whether the user rejected a previous confirmation request
- Confirm button should be disabled until original transaction is submitted.
Resolved part of this in #25468; we now prevent subsequent transactions from the send flow when an STX is pending. However, as @sleepytanya pointed out, subsequent transactions are still able to be submitted through dapp, which results in an infinite loading state.
Missing release label release-12.0.0 on issue. Adding release label release-12.0.0 on issue, as issue is linked to PR #25468 which has this release label.
The issue is present in the latest v12.0.0 build
Multiple transactions can be created while the STX mode is ON which results in 'Unapproved' transactions. 'Unapproved' transactions can be modified.
- Have STX transaction in 'Pending' state
- Start Swap transaction, confirm swap
- See 2 transactions within the Activity list
- Transaction in 'Unapproved state' can be edited (the token and the recipient address can be changed), but can't be rejected
- Select another token, click 'Confirm'
- Notice how the original swap tx 'Swap 1 BAT to SUSHI' changed to 'Send 0.1 USDC'
https://github.com/MetaMask/metamask-extension/assets/104780023/59898811-47cc-4f2e-9a2b-da1a0c94ab07
The issue is present:
https://github.com/MetaMask/metamask-extension/assets/104780023/366d12a6-acc6-440c-8608-db82fda782d7
~@sleepytanya can you test again on the latest build https://github.com/MetaMask/metamask-extension/pull/25098#issuecomment-2198759615~
Never mind, it looks like that is the build you tested with yesterday
On the latest v12.0.0 branch queueing is disabled if there is STX in Pending state:
Ethereum + Sepolia testnet
https://github.com/MetaMask/metamask-extension/assets/104780023/0b4c4e98-2a96-4dfd-a90e-a8d67dbca7f1
Ethereum + BNB Chain
https://github.com/MetaMask/metamask-extension/assets/104780023/c975bb9a-155b-44a4-9f4a-d9791a9f43e2
Ethereum + Ethereum
https://github.com/MetaMask/metamask-extension/assets/104780023/bd978710-1b9b-4708-96a0-e23a51c5ad7a
Thanks @sleepytanya - this is expected behavior for now 👍
@danjm I guess we can close this?
Fixed by: https://github.com/MetaMask/metamask-extension/pull/25478 https://github.com/MetaMask/metamask-extension/pull/25510
Collaborative Effort Required for Root Cause Analysis (RCA) on Critical Issues
We are quickly approaching the end of the quarter and we encourage you once again to take some moments and perform RCA on this critical issue. You may do so by answering the questions below:
1. What PR fixed the issue? 2. Can you pinpoint the commit from which the issue originated? 3. Write a short explanation of the technical cause of the bug 4. How could we have avoided merging this bug? What would have had to be different about our code, tests or processes? 4.1. Were there any missing unit, e2e or manual tests that could have preempted this issue? 4.2. Were there any other elements lacking, such as typed code, comprehensive documentation, well-architected APIs, etc., that might have prevented this issue? 4.3. If your answer to a and b is no, then is there anything at all that you can think of that, if it had been different before this bug was introduced, would have prevented it from being merged?
Please provide your answers as a reply to this comment and tag me as well.
You can read more about the initiative here. Thank you!
Tagging eng. who added the fix: @BZahory