WalletConnect Session Fails to Reconnect
See original GitHub issueHas anyone had WalletConnect session issues with the Unity Boilerplate?
If I start the app and authorize via QR with MetaMask, all operations including ETH/Token sending work fine.
But if I close the app and re-open it, the WalletConnect session almost never reconnects successfully. I can tell when it fails because it is supposed to ask the wallet to sign when the application launches afaik, and it does “rarely”, but most of the time restarting the game does not send a sign request to the wallet, causing the WalletConnect session to be invalid/non-working.
It has forced me to modify the boilerplate to force it to clear the WalletConnect session OnApplicationQuit
, so that each time the game is launched the User is prompted to re-scan the QR code aka restart the session. Otherwise, the User is given an experience where they have a Moralis User Session but DO NOT have a valid WalletConnect Session. This means that wallet balances show, but operations like Send ETH/Token do not work. The only way I found to fix this was to clear the session when the game quits and re-authorize via QR scan each time it starts…
Trashing the WalletConnect session OnApplicationQuit
by running MainMenuScript.Quit
a total of 10
times seems to be a consistent workaround for now. It also prevents a ton of extra MetaMask WalletConnect Sessions from existing. Before I did this, my MM app showed like 50
open sessions to my game. Now, once I close my game, I always have zero open sessions to my game.
The big downside with this is that it forces the player to re-scan their QR code each time they launch. For a VR game, this is more complicated to do…requires us to email them the QR code 🐒 Ideally it would only ask their wallet to sign, of course.
Thank you all for this glorious boilerplate!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
This is regrading to the inconsistency of wallet connect
@KoenRijpstra YAY! This is massive, we will test this ASAP tyvm!