Skip to content

Request for transaction that is going to fail, or with insufficient funds, results in silent failure with no error message #4646

@php4fan

Description

@php4fan

Describe the bug
I can't f***ing believe this. I was experiencing this issue seemingly randomly, and it took me several days to figure out that this happens systematically when a transaction is destined to fail or the account has insufficient funds.

Screenshots

To Reproduce
Steps to reproduce the behavior
0. In your MetaMask app, make sure you are connected to the BNB Smart Chain network.

  1. In a mobile browser, go to https://opentarget.org/test/stupid/mm/wc/
  2. Click on Connect
  3. Select "Wallet Connect"
  4. When prompted by the OS to choose an app, choose MetaMask
  5. In MetaMask, accept to connect
  6. Back in the web page, click on Send Transaction
  7. When prompted again by the OS, choose MetaMask

(steps 4 and 7 may be unnecessary if you have already told the OS to always use MetaMask)

The transaction being requested is one that would fail if executed, because of an error thrown from within the contract.

Expected behavior
MetaMask should open and show an error message alerting that the transaction is destined to fail (and should show the actual error message from the contract). Also, it should give you the option to continue anyway if you have sufficient funds.

Observed behavior
Most of the times, this: MetaMask shows up for a fraction of a second, just the main screen, with no error message and no information about the requested transaction. Then it immediately closes and gives control back to the browser.
No clue at all is given to the user that there's anything wrong with the transaction.

Sometimes, randomly, instead, this happens: after step 4 MetaMask doesn't even open at all. The OS prompted me to choose an application and I chose MetaMask, so the fault cannot be anywhere else than in MetaMask.


For comparison

Try the exact same steps above with this page instead:
https://opentarget.org/test/stupid/mm/wc/index2.html

This is exactly like the one above, but in this case the transaction is going to succeed (do not complete it, otherwise any subsequent attempt would fail and the test wouldn't work anymore).

In this case:

  • if you have sufficient funds, everything will work as expected and MetaMask will prompt you to confirm the transaction
  • if you don't have sufficient funds, then you'll observe the exact same issue as above. Here, MetaMask should show an error saying that you have insufficient funds; but instead, it will just immediately and silently close (or sometimes even doesn't show up in the first place).

Smartphone (please complete the following information):

  • Device: RedMi Note 10S
  • OS: Android 11
  • App Version: 5.2.0

to be added after bug submission by internal support / PM
Severity

  • How critical is the impact of this bug on a user?
  • Add stats if available on % of customers impacted
  • Is this visible to all users?
  • Is this tech debt?

Metadata

Metadata

Assignees

Labels

Sev2-normalAn issue that may lead to users misunderstanding some limited risks they are takingWalletConnectWalletConnect related issue or bugarea-transactionsteam-confirmations-planning(only for internal use within Confirmations team)type-bugSomething isn't working

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions