MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.66k stars 4.78k forks source link

[Bug]: UX Multichain: Better Handle Pending Manual + Dapp-Suggested Transactions Between Networks #25455

Open darkwing opened 2 weeks ago

darkwing commented 2 weeks ago

Describe the bug

When creating but not confirming a manual send on Network A, then switching to another tab that was last connected to Network B and doing a dapp-submitted transaction, the original confirmation for the Send "disappears".

Expected behavior

To be determined....

Screenshots/Recordings

https://github.com/MetaMask/metamask-extension/assets/46655/ede498a2-354f-4583-9ee7-7419eb4af80c

Steps to reproduce

  1. In tab 1, go to Test Dapp and connect to Sepolia
  2. In tab 2, manually open MetaMask and switch to Ethereum Mainnet
  3. Start a manual send on Ethereum Mainnet and get to the confirmation screen but don't confirm; the MetaMask badge icon will show the blue "..."
  4. Switch back to tab 1, click the MetaMask icon, see that we're still on Ethereum Mainnet and with the transaction confirmation you started (yay, we didn't auto-switch to Sepolia because a confirmation exists)
  5. Click "Send EIP1559 Transaction" in the test-dapp
  6. BEHAVIOR: The Mainnet transaction disappears, then the Sepolia send confirmation displays

Error messages or log output

No response

Version

develop

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

darkwing commented 2 weeks ago

By contrast, two dapp-suggested sends across chain work as I would expect: one after another:

https://github.com/MetaMask/metamask-extension/assets/46655/5034540c-3fbf-4a3d-98db-d05f5ce5a40e

jiexi commented 2 weeks ago

Confirmed, seeing this behavior on V12 1c7e132f5f4edeed815b2c9400c7cf09a5a26c91

jiexi commented 2 weeks ago

Being on a different network between the manual send and dapp transaction is key to repro

darkwing commented 1 week ago

We made the conscious decision to disable NetworkPicker in Send flow due to issues we ran into, and that the Network has never been allowable to switch mid-send. That would be why switching to a dapp on another network blows away the draft transaction. I think we should close this unless we can think of a more graceful way to let the user know the transaction will be gone

jiexi commented 1 week ago

What are you thoughts on keeping this open, but removing the release and regression tags?

hesterbruikman commented 1 week ago

@jiexi @darkwing apologies for the slow response. I agree with removing the release and regression tags. It's in any case not a regression as this is a sideeffect of dapp selected network introduced in v12.

I don't consider this a release blocker either. It's not expected for a previous transaction to disappear. But I consider the flow an edge case with no risk of funds loss.

Current

First confirmation request disappears. It looks like we don't switch network when toggling between dapps, but we do switch when a confirmation request comes in.

Expected