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

Reject tx on tx window close. #3124

Closed
tmashuang opened this issue Jan 29, 2018 · 6 comments · Fixed by #6340
Closed

Reject tx on tx window close. #3124

tmashuang opened this issue Jan 29, 2018 · 6 comments · Fixed by #6340

Comments

@tmashuang
Copy link
Contributor

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.

@tmashuang
Copy link
Contributor Author

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.

@farlenkov
Copy link

Short term solution is perfect for me :)

@tmashuang tmashuang changed the title Usability of uncommitted transactions Reject tx on tx window close. Jun 29, 2018
@mallapurbharat
Copy link

mallapurbharat commented Jul 11, 2018

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)?

@bitpshr
Copy link
Contributor

bitpshr commented Nov 8, 2018

Note that depending on the outcome of this ticket, approval requests should also be rejected in the same manner if the popup is closed.

@whymarrh
Copy link
Contributor

Merging #1152 into this, since this has newer content.

@danfinlay's main comment from there:

This is requested by @manidos on 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.

@whymarrh
Copy link
Contributor

From the conversation here and in #1152 we should reject all confirmation popups when closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants