airgap-it / beacon-sdk

The beacon sdk allows developers of dApps and wallets on Tezos to implement the wallet interaction standard tzip-10.
https://walletbeacon.io
MIT License
102 stars 64 forks source link

Error: No matching key #745

Closed klassare closed 3 months ago

klassare commented 4 months ago

Describe the bug (current behavior) WC2 error in the console

To Reproduce Steps to reproduce the behavior:

  1. Click "Request permission" in the example dapp
  2. Pair with a wallet that uses the wc2 transport
  3. refresh the dapp page
  4. send a request to the wallet

Screenshots and/or logs Skärmavbild 2024-03-26 kl  18 11 17

IsaccoSordo commented 4 months ago

Hi @klassare retrieving the session through signClient.session.get(signClient.session.keys[lastIndex]) seems to help, but it doesn't completely fix the issue. From time to time I still get The "No matching key error" after a page refresh. I tried also reproducing it through the WalletConnect's react-app but to no avail. I'll try open a followup issue in the WalletConnect repo, in the meantime I'm actively looking into this issue. Thanks for all the support.

IsaccoSordo commented 4 months ago

Hi @klassare The issue was caused by the following line in the constructor https://github.com/airgap-it/beacon-sdk/blob/3026e3f03644ff75c31bd56eb939d87e0513aa11/packages/beacon-transport-walletconnect/src/communication-client/WalletConnectCommunicationClient.ts#L117 which caused signClient to be initialized two times

IsaccoSordo commented 3 months ago

The "No matching key: history" fix has been addressed in v4.2.1