MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.87k stars 4.85k forks source link

Filters/Events/Logs not working correctly #2978

Closed kumavis closed 5 years ago

kumavis commented 6 years ago

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: https://github.com/MetaMask/metamask-extension/issues/1261 https://github.com/MetaMask/metamask-extension/issues/2752 https://github.com/MetaMask/metamask-extension/issues/2742 https://github.com/MetaMask/metamask-extension/issues/2393 ✅fixed https://github.com/MetaMask/metamask-extension/issues/2252 ✅fixed https://github.com/MetaMask/metamask-extension/issues/2114 ✅fixed https://github.com/MetaMask/metamask-extension/issues/2761 ✅fixed https://github.com/MetaMask/metamask-extension/issues/2952 ✅fixed

roehst commented 6 years ago

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 commented 6 years ago

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

onigiri-x commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Actually it was my mistake :( sorry!

bdresser commented 6 years ago

some issues possibly handled in #4279

bdresser commented 6 years ago

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 commented 5 years ago

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