-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Transaction receipt callback is not called on Metamask 4.12 #5425
Comments
Important to note that the truffle community and the web3.js community has been reporting this kind of errors recently. |
Could you share what JS library you are using to get these results? Please note web3 1.0 is in beta, and not yet supported by MetaMask. If you want to use these event-based APIs, you will need to connect to your own websocket-hosting ethereum server, as it is not provided by MetaMask at this time. You can still read from a different server, and propose transactions to the MetaMask API if you want to work around this limitation for now. Leaving open in case this isn't a websocket issue, but it really looks like one to me. I have not had any issues getting tx receipts with the latest MetaMask builds. |
@danfinlay can be a websocket issue. I've read something related too, but those who got problems with metamask 4.12, after downgraded to 4.11.1 and had no issues. Sorry, can't be more specific than that, since I'm not using 4.12 currently and I have no issues. |
@danfinlay I am using web3 1.0beta36 and this is the error I'm getting.
But everything has been working flawlessy for the last month and it's still working fine on metamask 4.9 and 4.11 so it should be something you can address. This will break the workflow for many dapps. |
This could be a very serious issue, but I'm unable to reproduce. A sample call that any MetaMask user can enter in their console while connected to the main network:
Returns the correct value for me. Can you provide reproduction steps or a reproduction app? Until we can reproduce the error, we cannot be sure that a given action will fix the issue. |
Alright, we’ve published a rollback to 4.11.1, called 4.13.0. We would still really appreciate reproduction steps. |
@danfinlay Thank you so much for your help. Here is a code snippet (Angular 6) to reproduce the issue. I'm using the lastest
This will not print the receipt on console with MetaMask 4.12 while I can confirm it is working fine again on 4.13. I hope this can help you to track down the issue. |
We do not currently support web3 1.0 beta since it depends on the subscriptions API. If you want promises and a similar interface, I recommend either ethjs, truffle-contract, or maybe ethers.js. I cannot promise that our next release will support web3 1.0 beta, it's surprising that it worked even momentarily. Closing as a duplicate of #3642. |
I confirmed this is because we don't support the subscriptions API, and apparently we did have a rudimentary version of subscription support previously. We need to port that subprovider to |
Are you going to port that in the next release or at a later time? So I know if I should migrate to another library or stick with web3 1.0. |
While MetaMask never officially supported subscriptions, we added a subscription subprovider to our provider-engine, which people began building on. We have since moved to json-rpc-engine, which lacks this subprovider. We thought this would be fine, since we never officially supported it, but apparently even Drizzle was building its UI framework on this API expectation, so we decided breaking was unacceptable. Rather than completely engineer a new subscription subprovider for json-rpc-engine, or add websocket support (yet), I came up with a very simple way of integrating our old support into the new inpage-provider. Should have the added benefit of automatic memory management, potentially solving memory leaks related to the old subscription support. Likely fixes #5425, pushing as a PR so we can provide the build to those affected devs and see if this fixes their issue.
We're hoping to not break this, since so many people are apparently building on our unofficial support, but we also have several critical issues "blocked" by this, so in some ways we're inclined to protect the API schedule we declared over the unofficial one we never supported. That said, I may have a fix: Could someone who was affected by this issue pull down one of these builds, and confirm if this fixes it? metamask-opera-4.14.0.zip You can also build from source and comment on that particular approach here. |
Metamask 4.14 is not working for me in any browser. It doesn't even recognize my account and the error is: |
Thanks for trying, sorry there was an issue. Looking into what could cause that now. |
We have been working implementing the web3 1.0 subscription method once again. Let us know if this build is breaking your dapps. |
Thank you for your efforts to fix this. I am really sorry to report that the new build isn't working. For every transaction, Metamask says Another thing that gets printed in console is |
I do get that error message too, but seemed to work just fine for me to send. Will track down where the error message is coming from. |
@AleG94 thanks so much for your help reproducing this issue. Would you mind sending us your state logs after getting that error, so we could inspect how the transaction was composed? You can send it privately to [email protected] https://metamask.zendesk.com/hc/en-us/articles/360015289832-How-to-Download-State-Logs-New-UI- |
I just sent the state logs. I can confirm that, despite the error, the transaction is being mined succesfully so it's probably just a display error. The receipt callback is also working fine now. The |
@danfinlay when you say you have no short term plans to support Web3 1.0 is this specifically support for the promi events and event watchers ? Will Web3 1.0 still work using callbacks for tx/call results or do you suggest a rollback to 0.20.x ? |
For me, it is coming from here, The catch results in |
Thanks for your patience. We have a new build that we hope has fixed this issue here: #5475 (comment) |
The new build is working fine for me but the |
That's great to hear! The warning should be very easy to fix: Is that warning in the page console, or which console do you see that in? |
The warning is shown in the browser console after I unlock my Metamask account. It's been present since the initial 4.12 (the one with the receipt bug) and it's still here in the lastest build. It's not present in 4.11 and 4.9. Everything seems to work as expected though. |
Hi, wanted to confirm I'm having the same issue as above with async/await - transaction success is confirmed in 4.13, but not 4.14. Similar to the above, the transaction goes through in MetaMask and is mined, but I never get a confirmation. I'm actually not getting any kind of error, just an extended wait. Also on web3 1.0.0beta.36. const result = await token.methods.transferFrom(user, owner, amount, 0).send({ from: user, gas: gas, chainId }) Do I need to refactor to callbacks to move forward? |
@allegramarie try v5.0.2 and let us know if you still have trouble https://github.com/MetaMask/metamask-extension/releases |
Thanks! I'm on v5.0.2, no change. |
@allegramarie Could I have the whole snippet? My steps to reproduce came up with no issues returning the tx details. This is my simpler repro snippet that can be ran in your project's console, the contract is on Ropsten.
|
Here's the whole snippet. I ran your repro on Ropsten and didn't have any issues getting a response in the console, but I'm on a private network with this contract.
|
Hi, All |
With MetaMask 4.12, the receipt is not returned in both callback and promise versions.
contract.methods.method().send({ from: address }).then(receipt => console.log(receipt))
contract.methods.method().send({ from: address }).on('receipt', function(receipt) { console.log(receipt); })
Both these examples are not working in Metamask 4.12 but working fine in 4.9
The text was updated successfully, but these errors were encountered: