Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events are inconsistently triggered #2255

Closed
szerintedmi opened this issue Oct 2, 2017 · 8 comments
Closed

events are inconsistently triggered #2255

szerintedmi opened this issue Oct 2, 2017 · 8 comments
Labels
area-background Issues relating to the extension background process. type-bug

Comments

@szerintedmi
Copy link

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);
@2-am-zzz 2-am-zzz added type-bug P3-soon needs-research area-background Issues relating to the extension background process. and removed area-background Issues relating to the extension background process. labels Oct 9, 2017
@danfinlay
Copy link
Contributor

May be related to MetaMask/web3-provider-engine#188

@kumavis
Copy link
Member

kumavis commented Oct 10, 2017

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

@okwme
Copy link

okwme commented Oct 13, 2017

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

@danfinlay danfinlay added P1-asap and removed P3-soon labels Oct 14, 2017
@kumavis
Copy link
Member

kumavis commented Oct 14, 2017

we're still looking for minimal reproduction steps

@fvictorio
Copy link

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.

@kumavis
Copy link
Member

kumavis commented Oct 20, 2017

@fvictorio should be fixed on master and shipping monday

@szerintedmi
Copy link
Author

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

@danfinlay
Copy link
Contributor

Closing as duplicate of #2393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-background Issues relating to the extension background process. type-bug
Projects
None yet
Development

No branches or pull requests

6 participants