WalletConnect / web-examples

Wallet and dapp examples implementing WalletConnect v2
https://walletconnect.com
Apache License 2.0
360 stars 319 forks source link

Remove try/catch block from signing requests. #575

Closed quetool closed 2 months ago

quetool commented 3 months ago

There's an issue currently in some chains such as Solana, Polkadot, Multiversex, Tron and Tezos where even if wallet responds with the appropriate JsonRPCError object during a rejection from the user the sample dapp will show a wrong dialog message due to a try/catch block wrapping the request.

This PR removes that try/catch block from these chains' method requests to match other chain's methods such as EVM, Kadena, Cosmos, etc...

Before PR:

https://github.com/WalletConnect/web-examples/assets/14978705/44c4d8f2-fd03-4ba1-b307-bd66d30bc7ad

After PR:

https://github.com/WalletConnect/web-examples/assets/14978705/02fde817-bed8-4ac4-bf6f-33d8d918e367

vercel[bot] commented 3 months ago

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

Name Status Preview Comments Updated (UTC)
decentralized-relay-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 11:51am
decentralized-relay-wallet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 11:51am
malicious-dapp-verify-simulation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 11:51am
react-dapp-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 11:51am
react-wallet-v2 ✅ Ready (Inspect) Visit Preview Jun 13, 2024 11:51am
7 Ignored Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **react-auth-dapp** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/react-auth-dapp/F8dSEtq5vkedFHfJj5gB91o764Vt)) | [Visit Preview](https://react-auth-dapp-git-bugfix-removetrycatch-3f7008-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am | | **react-auth-wallet** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/react-auth-wallet/hw2JwUGEA3cwaTwPhXHWivHn1qRv)) | [Visit Preview](https://react-auth-wallet-git-bugfix-removetrycat-08dc05-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am | | **react-dapp-v2-cosmos-provider** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/react-dapp-v2-cosmos-provider/GfABSHiCTDGxpDoESMYZnZUXVhB2)) | [Visit Preview](https://react-dapp-v2-cosmos-provider-git-bugfix-a0902a-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am | | **react-dapp-v2-with-ethers** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/react-dapp-v2-with-ethers/GYqrCV7R95xYwsnZ3LtYbgzyeP9G)) | [Visit Preview](https://react-dapp-v2-with-ethers-git-bugfix-remo-968ba1-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am | | **react-dapp-v2-with-web3js** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/react-dapp-v2-with-web3js/9yHJMAp78aL16j57Re42iCs2D3G7)) | [Visit Preview](https://react-dapp-v2-with-web3js-git-bugfix-remo-8a9262-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am | | **svelte-web3modal** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/svelte-web3modal/uu66mJQuFz4F19j7QiVxRhcUikqj)) | [Visit Preview](https://svelte-web3modal-git-bugfix-removetrycatc-d28238-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am | | **vue-dapp-auth** | ⬜️ Ignored ([Inspect](https://vercel.com/walletconnect/vue-dapp-auth/4XqnRUeW72qqHLCcjpYz6itDXrL4)) | [Visit Preview](https://vue-dapp-auth-git-bugfix-removetrycatchfr-afe1ee-walletconnect1.vercel.app) | | Jun 13, 2024 11:51am |
quetool commented 3 months ago

I'll try to fix tests ASAP

quetool commented 3 months ago

LGTM, thanks for the before/after 🙏

Unclear why the tests are failing here though if only the error message effectively changes, which it doesn't seem to asserting on. Re-running playwright.

Yeah I couldn't check it yet but re-running did fix it.