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

Bug: wallet connect error on mobile #258

Open
TorstenStueber opened this issue Nov 6, 2024 · 2 comments
Open

Bug: wallet connect error on mobile #258

TorstenStueber opened this issue Nov 6, 2024 · 2 comments
Assignees
Labels
type:bug Something isn't working

Comments

@TorstenStueber
Copy link
Member

This is an error that occurs when using Vortex on Safari iOS with the Metamask app.

The error occurred directly when signing the approval transaction in the Metamask app. The error occurs in the wallet connect source code and I could this issue.

Screenshot 2024-11-06 at 17 35 38

When this error occurs, the app never continues to proceed to the second signature.

Once this error happens, it happens again every single time at exactly the same moment.

Then error disappears when I reconnected the wallet. However, after starting/aborting/executing one flow, it will happen again on every subsequent flow. Until I reconnect again.

Once this error shows up for signing requests, the same error is also reported when pressing the disconnect button in order to reconnect the wallet.

@TorstenStueber TorstenStueber added the type:bug Something isn't working label Nov 6, 2024
@ebma ebma self-assigned this Nov 7, 2024
@ebma
Copy link
Member

ebma commented Nov 7, 2024

I can reproduce this issue with Metamask as well as Zerion wallet on my phone (connected with walletconnect in the system browser and not using an in-app browser). The transaction is signed and executed on the network but the app shows

Error: No matching key. history: 1731002864136426
    at qt2.getRecord (index.es-XIXAFQQV.js?v=07c245af:47181:13)
    at qt2.get (index.es-XIXAFQQV.js?v=07c245af:47130:181)
    at Zt2.onRelayEventResponse (index.es-XIXAFQQV.js?v=07c245af:47880:81)
    at EventEmitter.<anonymous> (index.es-XIXAFQQV.js?v=07c245af:48278:205)

each time.

Seems like this happens a bit arbitrarily though. The best chance is to have a fresh walletconnect connection established. From my testing, I feel like a page refresh after having connected to an account increases the likelihood of the 'No matching key' error to appear.

I found a selection of relevant tickets

At least to me, it seems like the WalletConnect connection is quite brittle. We might be better off by re-initializing the wallet connection on each page refresh if we are on mobile. I think walletconnect sessions are stored with the WALLETCONNECT_DEEPLINK_CHOICE local storage item so on app start, we can check if it exists, remove it and make sure that the wallet appears disconnected.
image

Preliminary conclusion

It seems like the problem is that something is off with the WalletConnect session after reloading the page. Thus, the easiest fix is to re-establish the connection, every time the page is refreshed. Since this is mainly a problem with WalletConnect and the wallet connection in general (e.g. on Desktop) is unaffected, we should only re-initialize the wallet connection on mobile after a page refresh.

@TorstenStueber
Copy link
Member Author

It's almost good that this error occurs so widely. This indicates that there is some good work around, such as the one you propose here. Let's see whether it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@ebma @TorstenStueber and others