-
Notifications
You must be signed in to change notification settings - Fork 7
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
[BUGFIX] Stale WalletConnect Session #1406
Conversation
✅ Deploy Preview for fractal-framework-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't think that this code actually delays anything from happening... the onClick
handler is synchronous and so execution won't wait for the timer to complete.
@adamgall . Yeah it was for delaying the function from finishing. But this delay wasn't fixing the problem. I just edited the PR description and pushed a new commit but.
|
@Da-Colon can you please open an issue for this PR, add it to the new Fractal project (yeah yeah i know, going back to just a single project board), and fill in the appropriate custom data? |
@adamgall no worries can do. |
This is not my experience on the dev site. I'm able to connect via WC, disconnect using the Fractal app, then immediately connect again with WC without a refresh. |
@adamgall hmmm you are right, I'm not able to reproduce on dev...weird. it was very consistent and was easy to reproduce yesterday |
Closing PR for now, currently not able to reproduce on dev. Will keep an eye out if it becomes an issue |
Description
Looking into MPCVault Wallet Connections, I noticed than after disconnecting from Wallets connected via WalletConnect. I am unable to reopen the wallet connect menu and the Console shows errors related to the session key not matching and then showing
core/relayer
errors.After looking at the setup. It appears that what is happening is that for some reason after clicking
disconnect
that the menu closes and causes the func to end before updating local storage that the session has ended. This causes WAGMI and Walletconnect to desync.Adding a small delay (setTimeout
) after execution of disconnect fixes this issue.Instead of using AppState to determine connection status, as this seems to be updated quicker than wagmi's state. switching out to use
useWalletClient
to determine connection status seems to be a better fix.Testing
First see the error on dev:
On deploy preview do the same thing and you should notice that you are able to click into the WalletConnect QR code again. (You may need to refresh browser after testing the error)