Metamask-extension: Accounts and Network are not immediately set after Approved promise is resolved.

Created on 23 Oct 2018  路  3Comments  路  Source: MetaMask/metamask-extension

Describe the bug
web3.eth.accounts and web3.version.network is not immediately populated after resolved promise ethereum.enable()

To Reproduce
Steps to reproduce the behavior:

  1. Click on APPROVE
  2. web3.eth.accounts and web3.version.network has to wait around 30ms to get populated (times are not consistent)
  3. Same thing happen when host is already approved

Expected behavior
Account and Network variables should be set when .enabled() is resolved.

Browser details (please complete the following information):

  • OS: OSX
  • Browser: Firefox, Opera
  • MetaMask Version 4.16.0
  • New / Beta UI / EIP-1102 / cf02009:

Most helpful comment

Hi @zlyojciec and @simondlr, thanks very much for reporting this issue. The error was caused by a race condition between when the ethereum#enable Promise was resolved and when an internal MetaMask configuration store populated. This has been fixed as of 634121de6125d4faab5d815d981e62aff8946290 and new builds can be found here to use for verification.

Don't hesitate to let us know if you experience any additional issues while testing.

All 3 comments

Just want report that this is fairly random to me. Sometimes it happens more frequently, sometimes it doesn't.

Hi @zlyojciec and @simondlr, thanks very much for reporting this issue. The error was caused by a race condition between when the ethereum#enable Promise was resolved and when an internal MetaMask configuration store populated. This has been fixed as of 634121de6125d4faab5d815d981e62aff8946290 and new builds can be found here to use for verification.

Don't hesitate to let us know if you experience any additional issues while testing.

Works perfect now. Thank you for quick update!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dpazdan picture dpazdan  路  3Comments

MarkOSullivan94 picture MarkOSullivan94  路  3Comments

kumavis picture kumavis  路  3Comments

estebanmino picture estebanmino  路  3Comments

glitch003 picture glitch003  路  3Comments