tahowallet / extension

Taho, the community owned and operated Web3 wallet.
https://taho.xyz
GNU General Public License v3.0
3.11k stars 394 forks source link

issue with automatically switching networks from Stargate transfer page #3603

Open beemeeupnow opened 1 year ago

beemeeupnow commented 1 year ago

Discord Discussion Link

No response

What browsers are you seeing the problem on?

Chrome

What were you trying to do?

Wallet should change networks automatically at the app's request, but for some reason something is getting stuck when using Stargate.

I can't tell if it's the wallet or the dapp causing the problem.

Workaround: refresh the page if clicking the 'Transfer' button does nothing. The relevant network will now be active.

If you get lucky and it works on the first time you click Transfer, continue following these steps:

What did not work?

It seems like the network did not actually get changed.

Nothing happens when you click the "Transfer" button unless you refresh the page.

Version

v0.47.0

Relevant log output

// Console of the webpage seems to indicate we handle the request
content: inpage > background: {"id":"12","target":"tally-provider-bridge","request":{"method":"wallet_switchEthereumChain","params":[{"chainId":"0xA4B1"}]}}

provider-bridge.js:1140  content: background > inpage: {"id":"12","jsonrpc":"2.0","result":null}
Shadowfiend commented 1 year ago

This works pretty consistently for me, which means it's probably a timing issue, my least favorite kind to debug 😔

Also:

open the wallet UI and change to another different network

This does not have an impact on the active network for the dApp. These are (deliberately) managed independently. So switching the network in the wallet UI and reloading Stargate should result in the same active network in Stargate.

beemeeupnow commented 1 year ago

I'm aware of the connection separation, but noted it since for some unknown reason it made it more likely to reproduce for me.

Shadowfiend commented 1 year ago

Got it. On the chance that this would indeed help me reproduce I did try it last week, unfortunately I didn't see it happen :( Previously we saw this happening when event handlers on the underlying provider weren't being redirected properly when Taho landed as the default provider.

Any chance you had more than MetaMask + Taho installed? Wondering if there's an order-of-loading thing at play here as well.

beemeeupnow commented 1 year ago

Only Taho installed.

I just found that the issue does not happen if I switch the 'Taho as default' off.

The issue reproduces quite frequently if I leave it on. It also seems to not happen when selecting ETH for the 'from' asset, only a different/ERC20 asset.

If there's something I can do to help identify the issue, let me know.