walletconnect-monorepo: Transactions failed to be sent to mobile device

Randomly it seems like when a user is prompted to submit a tx - the tx is never sent to their connected device.

This is hard to replicate as in our dapp it works sometimes, and fails sometimes. Almost like its an internet issue (although its not, as I have a stable fast connection on both devices).

Replication is hard - but I’ve noticed:

If a user directly connects to walletconnect -> accepts in their mobile device -> then uses the dapp to submit a tx it almost never fails.

But when a user has already connected their wallet, and then they refresh the page or come back to it after a day or two, then once connecting again (not via their device just by clicking on walletconnect in web3modal) there is a good chance the transaction will never appear on their device.

I’ve posted in the discord with no real support, but here is the code I’m using for walletconnect and web3modal:

 const providerOptions = {
        walletconnect: {
          package: WalletConnectProvider, // required
          options: {
            infuraId: "a6xxxxxxxxxxxxxxx1", // required
          },
        },
        fortmatic: {
          package: Fortmatic, // required
          options: {
            key: "FORTMATIC_KEY", // required
          },
        },
      };
      const web3Modal = new Web3Modal({
        cacheProvider: false, // optional
        providerOptions, // required
      });
      const provider = await web3Modal.connect();
      store.dispatch({ type: "WEB3_CONNECTED", data: provider });
      this.props.handleCloseWalletModal();

The connection seems fine - in terms of when a user refreshes the page and presses walletconnect again - the web3 connection is on the correct network, and is able to create the instance of contract/estimate gas/present the tx data to web3.

It just fails hits the users device for them to submit, somewhat randomly.

Why would this happen? What aspect of our code/walletconnect would affect this? Is there something we can check/confirm is working that would make the tx fail to be sent to the user after reconnecting from page refresh?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Hello guys,

Any update of this problem ?

I’m able to reproduce it any time even on Uniswap.

  • Just connect your Metamask wallet on Uniswap with Wallet Connect (On a Android Device)
  • Turn off your internet connection (or your screen during 5 minutes)
  • Turn on your internet connection and wait few seconds
  • Try to send a transaction with Metamask
  • Metamask opens but no transaction confirmation popup appears
  • The only way to make it works again is to kill all apps then try to reconnect with Wallet connect several times and it ended up working.

It’s a really annoying problem even for the biggest dApps like Uniswap! This should be a priority in your backlog guys !

I can confirm that I also experience this with my wallet (Argent) everywhere I use WalletConnect (Oasis, Uniswap, Gnosis Safe). It seems that when there is no activity for a longer period the connection breaks. The UIs still show my address and that I am connected, but when I initiate a transaction nothing shows up on my phone while the UI waits for me to confirm. It is then necessary to manually disconnect and connect again using the QR code.