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

feat: WalletConnect - advanced error handling #2315

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

dianasavvatina
Copy link
Contributor

@dianasavvatina dianasavvatina commented Jan 8, 2025

Proposed changes

Significantly improved error handling:

  • on user reject, now send the response to the dApp
  • handle TezosOperationError: pass data about failure to dApp. Now tests on failure pass in Taquito Test dApp
  • provide unique and understandable error text to user (allows to google for the same problem)
    • if the error text is parsed, it's provided. If not, the error is more generic. Details are provided since they are unique for the
      contract involved by the user.

The implementation follows:

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

  1. connect via WalletConnect Taquito Test dApp https://taquito-test-dapp.pages.dev/
  2. run tests. All should pass:
  "Contract call with int",
  "Contract call with (pair nat string)",
  "Contract call that fails",
  "Contract call that fails with int",
  "Contract call that fails with (pair int string)",
  1. run test "Contract call with int" and close the request on wallet side. Make sure that dApp received code and message.
  2. run TezosProvider dapp, feat: added tezos-provider dapp example reown-com/web-examples#697
  3. Connect to ghostnet
  4. Run Sign and close the request on wallet side. Check that dApp received code and message about user reject
  5. Run Send transaction and close the request on wallet side. Check that dApp received code and message about user reject
  6. Run delegate twice for the same address. Make sure that dApp received code, message and data

Screenshots

Add the screenshots of how the app used to look like and how it looks now

Error log

  • TezosOperationError is recognised:
    Response:
{
  "code": 4009,
  "message": "Rejected by chain. The delegate is unchanged. Delegation to this address is already done. Details: (temporary) proto.020-PsParisC.delegate.unchanged",
  "data": [
    "proto.020-PsParisC.delegate.unchanged"
  ]
}

Error log:
image
Toast:
image

  • TezosOperationError is not recognised:
    Error log:
image

Toast:
image

  • Failed request to contract returns data

Toast:
image
All necessary data is returned to dApp and the reject message is sent to logs:
image

  • User rejected operation are reported to dApp:

Sign:
image

Send:
image

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

Copy link

vercel bot commented Jan 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-embed-iframe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:23pm
umami-embed-iframe-ghostnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:23pm
umami-v2-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:23pm
umami-v2-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 3:23pm

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

Successfully merging this pull request may close these issues.

1 participant