Originally posted by @farlenkov https://github.com/MetaMask/hello/issues/49
If in my Dapp I call MyContract.MyFunc(xyz, function(error, result){ }); User will see a MetaMask popup. My my code will get response only if user press SUBMIT or REJECT. But if user close this popup and refresh page my code will never know status of this transaction although user still can open MetaMask and submit this transaction.
I need to show my users all of their transactions. Is there any way to get unsubmited transactions from MetaMask? Or better to automatically REJECT transaction on popup window close?
PS. This uncommitted transactions leads to terrible user experience: if user has one or more of those uncommitted transactions and click on some "buy" button in the dapp, then in MetaMask window user will see not this exact transaction request, but the oldest one from the list of uncommitted transactions.
This oldest transaction may have different value or (in worst case) same value. User can submit this oldest transaction while thinking that it is the latest one. And as result user will don't understand what is going on and why.
Short term solution:
- Reject tx on tx window close.
Longer term solution:
- API for tracking txs, even before approval. I remember Parity suggested an API like that in an EIP, would help if someone could find that and link it here.
Short term solution is perfect for me :)
I don't think the "short term solution" of "reject tx on window close" has been implemented yet.
I am still not seeing the expected error of "User denied transaction" when I close the transaction window. Is it possible to detect when user closes metamask transaction window instead of cancelling transaction (which is catchable as error)?
Note that depending on the outcome of this ticket, approval requests should also be rejected in the same manner if the popup is closed.
Merging #1152 into this, since this has newer content.
@danfinlay's main comment from there:
This is requested by
@manidoson slack.They said:
rejection of the current transaction when popup is closed works for me. I need this feature, because when I prompt a user to sign something I hide the target button and when popup is closed by the user I have no way to detect it and show the button again. So, yeah, it would be awesome if clicking on close rejected the transaction.
From the conversation here and in #1152 we should reject all confirmation popups when closed.
Most helpful comment
From the conversation here and in #1152 we should reject all confirmation popups when closed.