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

Switching networks causes filter/event callbacks to silently fail #2252

Closed
iwooden opened this issue Oct 2, 2017 · 0 comments
Closed

Switching networks causes filter/event callbacks to silently fail #2252

iwooden opened this issue Oct 2, 2017 · 0 comments
Labels
area-provider Relating to the provider module.

Comments

@iwooden
Copy link

iwooden commented Oct 2, 2017

When I first start up Chrome and use Metamask, web3 fires filter/event callbacks as expected. This works for the Ethereum mainnet, as well as the Rinkeby and Kovan test networks.

However, after changing networks in Metamask, filters/event callback functions silently stop being called. Once the network has been switched, any site the user visits will be unable to use filters/event callbacks. This behavior remains until Chrome is restarted.

Metamask version: 3.10.8

Repro steps: Start a fresh Chrome session. Paste following code into the Chrome javascript console:

var lastestBlockFilter = web3.eth.filter('latest');
lastestBlockFilter.watch((err, res) => {
    console.log(res);
});

You should get a stream of block hashes in the console. Switch networks in Metamask, refresh, and paste the code into the console again. Block information will stop being populated. This persists even if you switch back to the original network.

Probably related to the following issue:
#2114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-provider Relating to the provider module.
Projects
None yet
Development

No branches or pull requests

3 participants