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

@walletconnect/web3-provider not rejecting the promise on eth_sendTransaction when user deny it #375

Closed
wighawag opened this issue Oct 19, 2020 · 11 comments

Comments

@wighawag
Copy link

@walletconnect/web3-provider is not rejecting the request promise on eth_sendTransaction when the user deny it on its mobile wallet (tested on metamask)
Instead the promise never resolve. leaving the app to decide what to do.

This is unfortunate as this force the app to make the user decline the tx twice, once on its wallet and once again in the app.

It would be better if walletconnect web3-provider reject the promise when the user deny the tx on its wallet

@miohtama
Copy link
Collaborator

Here is my old code to detect the rejection. Though I think I ever tested this with MetaMask desktop. I have not tested this with the latest wallet versions.

https://gist.github.com/miohtama/a91a5edabac6bf66de860a444fc13206#file-transaction-helper-component-ts-L344

Please tell me if it is helpful or not working - if the behavior is different with MetaMask desktop we need to find a way to address this.

@wighawag
Copy link
Author

hmm, I am referring to user rejecting "pressing cancel"
it should reject the promise on @walletconnect/web3-provider side
and so I do not even expect a tx hash

@miohtama
Copy link
Collaborator

Yep, so this is how I handled with MetaMask desktop back in the day. You get the thrown error and then you need to figure out from crappy JavaScript exceptions that do not have a class what kind of an error this was. But if you are not getting an error in the first place then that's an issue.

@wighawag
Copy link
Author

Yes exactly, the issue is that the promise never resolve, nor reject

@swkim109
Copy link

It has to be noted that EIP-1193 exists. This standard says when user rejects request, the Provider should return the status code of 4001. It seems like MetaMask desktop follows this standard.

@wighawag
Copy link
Author

Any update on this?
This is an issue for user experience and would be great if wallet connect followed EIP-1193 in that regard as @swkim109 mentioned.

@kamapcrazy
Copy link

same issue on my side.
When user scan qr-code to connect wallet.
And then, they somehow decide to cancel. We cannot catch any errors from client-side in order to take action on it.

@trylovetom
Copy link

@kamapcrazy same here

@insky
Copy link

insky commented Sep 5, 2022

Any updates?

@finessevanes
Copy link
Contributor

Hey @kamapcrazy ,@trylovetom ,@insky, @wighawag are either of you still experiencing this issue?

@insky
Copy link

insky commented Dec 13, 2022

Hey @kamapcrazy ,@trylovetom ,@insky, @wighawag are either of you still experiencing this issue?

Looks like fixed

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

No branches or pull requests

7 participants