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

Redirect user to application for failed transaction #2918

Open
Likbes opened this issue Sep 19, 2022 · 2 comments
Open

Redirect user to application for failed transaction #2918

Likbes opened this issue Sep 19, 2022 · 2 comments

Comments

@Likbes
Copy link

Likbes commented Sep 19, 2022

Problem
I just encountered that after an unsuccessful transaction, the wallet did not redirect me back to the application. In my application, I would like to make the ability to "try again" with updated data so that a new transaction is more likely to be successful.

I mean that with a successful transaction, the user is redirected back to the application, but not with an unsuccessful transaction. The only way to go back to the application that he used to send this transaction is to press cancel, and then the user will be returned with the code user rejected & error text.

Is it possible to somehow return the user to the application even if the transaction fails?

Expected Behavior
Have an ability with some param in wallet method signAndSendTransaction(s) redirect user to application in case of failed transaction.

Steps to reproduce

  1. Receive failed TX
  2. Profit
@roshaans
Copy link
Contributor

Can you please provide a concrete example of this?

I tried to cancel a transaction once redirected to the Near Wallet from a dapp and it took me back to the Dapp page.

I also simulated a failed transaction from the Near Wallet from a dapp and it also successfully took me back to the Dapp.

This seems like it would be dependent on the client and what they specified for the callbackURL when calling signAndSendTransaction from near-api-js.

@Likbes
Copy link
Author

Likbes commented Sep 19, 2022

Yeah, redirecting user after clicking on "Cancel" works well, but...

I'm afraid that it may not be clear to the user what he needs to do in case of an error.
For me personally it was not obvious that in case of an error I should press "cancel".
It seems to me that to improve the UX of a Dapp, the error handles themselves should be handled and in order to implement this behavior, I want to ask you to add this feature (optional ability to redirect user to Dapp even in case of error).

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

No branches or pull requests

2 participants