trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
724 stars 252 forks source link

Action not completed Action cancelled by user / VM27:1 MetaMask - RPC Error: Error: Popup closed #12446

Open 0xGitGuy opened 6 months ago

0xGitGuy commented 6 months ago

Describe the bug When you accidentally close trezor popup windows when signing for dapps like 1inch.io, the next attempt will cause the user to be unable to sign anymore transaction on Metamask. The trezor will be stuck and the only way to fix this is to deactivate metmask extension and enabling it again. So imagine a dapp action requiring 3 steps like (approve, sign, broadcast), pita. A non-hw address on metamask does not exhibit this issue. The last time Model One firmware had an update was March 2023 (1 years+ ago). Does Trezor deprecate support for older devices over time? (this sucks though for storing funds)

Firmware version and revision Brave (1.65.133 (May 14, 2024)), Windows 10, Metamask (11.15.4) , Trezor Model One (1.12.1)

Desktop/smartphone setup (please complete the following information): as above

To Reproduce Steps to reproduce the behavior:

  1. attempt to sign a transaction at 1inch.io
  2. once trezor model one hardware shows some text to sign, click Confirm on metamask once first
  3. once you see the popup.html, close the trezor pop up window on your pc
  4. now try the same transaction for 1inch.io again
  5. you either get a infinite trezor loading screen or it shows you an error

Expected behavior Type 4 signing should be able to sign transaction without resetting Metamask on the second transaction attempt

Screenshots If applicable, add screenshots to help explain your problem. Dapp console error shows: VM27:1 MetaMask - RPC Error: Error: Popup closed

Trezor popup.html windows error shows: Action not completed Action cancelled by user. (Eternally spinning the loading image)

Additional context Add any other context about the problem here. I did have a way to trigger the Model One again for the second transaction but it's way too cumbersome and not normal UI

Hannsek commented 6 months ago

Does Trezor deprecate support for older devices over time?

The support for this device was not deprecated. There was no need to release new fw for Model 1.

the next attempt will cause the user to be unable to sign anymore transaction on Metamask.

How does it look You should trigger signing the transaction in MM again and Connect popup should popup again.

0xGitGuy commented 6 months ago

the next attempt will cause the user to be unable to sign anymore transaction on Metamask.

How does it look You should trigger signing the transaction in MM again and Connect popup should popup again.

Just for clarification, yes, this is correct. It should cancel the previous transaction and push the newly attempted transaction to Model One.

Hannsek commented 6 months ago

So what happens when you click on sign in MM again?

0xGitGuy commented 6 months ago

So what happens when you click on sign in MM again?

Model One screen gets stuck from the previous transaction. Clicking either buttons or triggering another transaction on Metamask doesn't do anything to change Model One screen. I need to disable metamask. In most cases,

Hannsek commented 6 months ago

Ok, we'll investigate. cc @trezor/qa

bosomt commented 6 months ago

QA OK

Tried to send Eth transaction via https://app.1inch.io/#/1/simple/swap/ETH Closed popup multiple times https://connect.trezor.io/9/popup.html It was auto opened till Transaction rejected was triggered After that i was able to open popup again without any kind of problem.

bosomt commented 6 months ago
0xGitGuy commented 6 months ago
  • Tried to rexplicate by 1inch + MeaMask + https://metamask.github.io/test-dapp/
  • got when trying to sign v4 data not sure if related see video https://youtu.be/cU7vdPauERc
  • Error in testdapp: Result: Error: Keyring Controller signTypedMessage: Error: Device is used in another window
  • Error in connect popup before confirming passphrase
image

oh yes, this is it! Same console errors as I got. Boy, I wished metamask and trezor don't do this to me every now and then when it force updates.

Did you find a temp way to quickly recover from the bug without disable/enable metamask and go through the password/allow phases?

mroz22 commented 6 months ago

When you accidentally close trezor popup windows when signing

Yes, I confirm this is where the problem starts. In the best case scenario, trezor-connect should successfully "release" device when connect-popup is closed. There are couple of modes of how trezor-connect can be used, and we are actually fixing this problem in one of the scenarios (different from yours) here.

Could you @martykan please check if core in iframe mode actually releases device if it learns about the fact that popup was closed? I think it should but apparently it does not.

As I stated above, this is the best case scenario, so it is not guaranteed that it will succeed. So there should be a fallback in popup, a button "use device here". This button is there but for some reason popup closes sooner before this button is rendered.

Anyway thanks for reporting, we are already investigating.

bosomt commented 5 months ago

Sorry im not able to reproduce this issue today :))) Tried to run new and old bridge with no luck Even opened Rabby wallet in same browser so it will interupt connection but i was able to sign v4 data 10 of 10 times...