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

Filters/Events/Logs not working correctly #2978

Closed
kumavis opened this issue Jan 15, 2018 · 8 comments
Closed

Filters/Events/Logs not working correctly #2978

kumavis opened this issue Jan 15, 2018 · 8 comments
Assignees
Labels
area-provider Relating to the provider module. blocked type-bug

Comments

@kumavis
Copy link
Member

kumavis commented Jan 15, 2018

There are lots of claims of events working inconsistently.
There may be multiple bugs at play here.
Some of them may have been resolved.
Some of them are associated with changing the provider.
Some of these are associated with resetting testrpc/ganache server without telling metamask.
This may involve getting results from an out-of-sync backend.

This ticket is for linking potential duplicate issues and discussing bounties

associated issues:
#1261
#2752
#2742
#2393 ✅fixed
#2252 ✅fixed
#2114 ✅fixed
#2761 ✅fixed
#2952 ✅fixed

@roehst
Copy link

roehst commented Jan 29, 2018

Hello, I would like to ask for a quick comment on what are the alternatives that small application could use. It must refresh a model everytime the user changes it by clicking a button and performing an action, and ideally it could show other kinds of changes (from other users) in realtime.

I think of polling every n secs or triggering refreshes after specific UI cues. Are there other ways this could be done?

Thanks!

@danfinlay
Copy link
Contributor

Some workaround options for devs that don't want to rely on events/logs when they don't work reliably:

  • Write your own events/logs middleware and try pollyfilling it for your own backend.
  • Simply store event-like data in a centralized database/index, and use that for serving your UI. That data can be regularly re-synced with blockchain data, but can be much faster for recall if it's exclusively caching your app's data.

@onigiri-x
Copy link

onigiri-x commented Apr 26, 2018

Hi there,
Referencing #2742 , I'm running into an issue here as well. I have a dapp which is functioning just fine, and I have a more complex and gas intensive function I call to. This is a smart contract function which acts to bulk call to add a list of addresses. It behaves differently from the other function calls with the same web3 code.

listing.addMultipleToList(addresses,payload, {from: adminAccount}).then(function() {
self.setAlert("Addresses were added!", "success");
}).catch(function(err) {
myApp.throwError("Request completed");
console.log(err);
});

The metamask transaction launches, I accept the transaction, after 5-10 seconds the block has been mined and the contract function called successfully. This behaves as my other calls do.

But I seem to catch an exception with the contract call (weird) and in the console the error being presented is "Uncaught (in promise)"

Right now Im investigating a workaround for this and also what web3 1.0 has to offer.
All the best.

@danfinlay
Copy link
Contributor

Right now Im investigating a workaround for this and also what web3 1.0 has to offer.

Just a warning, MetaMask does not currently support Web3 1.0 or later.

If you could provide a reproduction use case, and provide it in a new issue, we could try to find the cause of your problem.

@onigiri-x
Copy link

Actually it was my mistake :( sorry!

@bdresser bdresser changed the title Bounty: Filters/Events/Logs not working correctly Filters/Events/Logs not working correctly Jun 6, 2018
@bdresser bdresser assigned bdresser and kumavis and unassigned bdresser Jun 6, 2018
@bdresser
Copy link
Contributor

bdresser commented Jul 10, 2018

some issues possibly handled in #4279

@bdresser
Copy link
Contributor

Thanks for the detail @lazaridiscom. I've updated the original post accordingly and followed up on some of the remaining open issues.

I'll check back in here after the provider rewrite (#4279) is merged to see if it has affected anything else.

@kumavis
Copy link
Member Author

kumavis commented Oct 10, 2018

If you encounter an issue with Filters/Events/Logs/Subscriptions, please open a new issue describing your situation and example code + reproduction steps

@kumavis kumavis closed this as completed Oct 10, 2018
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. blocked type-bug
Projects
None yet
Development

No branches or pull requests

5 participants