metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

[Bug]: Auto-Lock Timer not taking into account virtual machine sleep time

Open Gokko558 opened this issue 2 years ago • 0 comments

Describe the bug

When running metamask inside chrome on a win10 virtual machine on a win10 vmware host, the auto-lock timer will stop it's tick when the vm is suspended or paused by vmware. So when I log into metamask, pause the vm, resume it the next day, metamask is still unlocked. (There is no discrepancy between the vm/host's clocks after the vm resume.)

Steps to reproduce

  1. log into metamask on chrome on a win10 vmware vm
  2. pause the vm
  3. resume the vm after you expect the auto-lock timer expires.
  4. Meta is still unlocked

Error messages or log output

No response

Version

MetaMask Version 10.14.6

Build type

No response

Browser

Chrome

Operating system

Windows

Hardware wallet

No response

Additional context

https://github.com/MetaMask/metamask-extension/blob/652d631cda4f1bd29b028189abc9c1e40598e1f0/app/scripts/controllers/app-state.js#L192-L195

I'd guess setTimeout is not reliable for use inside vm's. Checking for lock-expiration every second would fix it.

Gokko558 avatar Aug 08 '22 17:08 Gokko558