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);
May be related to https://github.com/MetaMask/provider-engine/issues/188
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
Closing as duplicate of https://github.com/MetaMask/metamask-extension/issues/2393