Metamask-extension: events are inconsistently triggered

Created on 2 Oct 2017  路  8Comments  路  Source: MetaMask/metamask-extension

Behaviour of events watch changed recently (unsure from which Metamask release).
When I submit a transaction and it emits an event then my watch function is not called - it used pick up that event. Without Metamask it still works as it used to and as it's expected.

When I refresh the page then suddenly all, even older event handlers called, despite I'm using { fromBlock: "latest", toBlock: "pending" }. It works as expected without Metamask (i.e. only event in latest block is triggered on first load/refresh).

MacOs Sierra 10.12.6
Chrome 61.0.3163.100 (Official Build) (64-bit)
Metamask 3.10.8
Web3 1.0.0-beta.22

 myContract
   .myEvent({ fromBlock: "latest", toBlock: "pending" })
   .watch(onMyEvent);
L04-backencore P1-asap T00-bug

All 8 comments

seems like we need to resolve latest to the actual block number on filter creation time

found this happening a lot on local dev. solution was to disable extension and re-enable and unlock.

we're still looking for minimal reproduction steps

Hi, I created a repo to reproduce this issue. I don't know if it's the same issue that OP has; if it isn't, I can create a new issue. This reproduction steps are specifically for the issue of MetaMask handling events correctly in Rinkeby but not in testrpc.

https://github.com/fvictorio/metamask-events-bug

The instructions are in the README. Let me know if you need more info.

@fvictorio should be fixed on master and shipping monday

As of Metamask 3.12.0 we're still having this issue. W/o Metamask it works fine.
Any update?

Web3 1.0.0-beta.26
Chrome Version 62.0.3202.94 (Official Build) (64-bit)
MacOs High Sierra 10.13.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aakilfernandes picture aakilfernandes  路  3Comments

kumavis picture kumavis  路  3Comments

hellobart picture hellobart  路  3Comments

whyrusleeping picture whyrusleeping  路  3Comments

glitch003 picture glitch003  路  3Comments