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]: Multichain - When editing a transaction, clicking Continue does nothing and I remain in the Edit page #23114

Open seaona opened 4 months ago

seaona commented 4 months ago

Describe the bug

Problem: whenever I start a transaction and I land into the last confirmation screen, if I click Edit I am able to change the network. However, if I change the network I am not able to proceed to the next screen, clicking Continue does nothing and I see the following error in the UI TypeError: Cannot read properties of undefined (reading 'userEditedGasLimit')

Expected behavior

Clicking Continue should land me to the last confirmation screen with the updated network? Or, if we don't want the user to change networks when editing a transaction, the network switch should then be disabled.

cc @hesterbruikman @bschorchit not sure which is the expectation here

Screenshots/Recordings

https://github.com/MetaMask/metamask-extension/assets/54408225/8629950b-e799-4524-8d32-812eb5b5d167

Steps to reproduce

  1. Start a transaction
  2. Add recipient and amount
  3. Click Continue
  4. On the last confirmation screen, click Edit
  5. Change networks
  6. Click Continue
  7. See nothing happens and a console error appears

Error messages or log output

No response

Version

develop - with multichain flag

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

Bullcoiner commented 4 months ago

Hi There, Thank you for reporting this to us. It has been reported to a team and will be looked at.

darkwing commented 4 months ago

Seeing this error in the console:

SES_UNHANDLED_REJECTION: TypeError: Cannot read properties of undefined (reading 'userEditedGasLimit')
  at send.js:2330:26

After changing networks, unapprovedTxs becomes an empty object so unapprovedTx is undefined. The error is triggered by:

gas: unapprovedTx.userEditedGasLimit
          ? unapprovedTx.txParams.gas
          : txParams.gas

draftTransaction does exist so changing teh network is somehow clearing unapprovedTxs.

SCR-20240222-ttht

Continuously editing the transaction without changing network works properly, so this issue is specific to changing networks.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.