metamask-mobile
metamask-mobile copied to clipboard
Do not reconnect to older sessions when requesting a new wallet connect session
Description When trying to create a new wallet session, we were also reconnecting to the older sessions.
Proposed Solution Created a lifetime for each session, it will not live longer than 24 hours, and any session with 2 days of life when the app initialises will be killed. The user will need to reconnect to the dapp.
The user will also have their connections lifetime updated every time he shows he is active, being active means he starts a new session, kills a session or disconnects from any dapp
Created a limit number of wallet connect sessions, the limit number is 20, when a user has 20 connections, the first one will be ended.
Test Cases This is a very hard-to-test feature! What we can do is test all the Wallet Connect flow doesn't break. For that I used (from laptop and from the mobile phone chrome browser):
- https://example.walletconnect.org/
- https://web3modal.com/
Code Impact Low
Issue
Progresses #4759
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.
It's WIP
Sorry @tommasini , we've been very bad lol

@andreahaku You guys have been awesome ❤️
Closing this PR because was merged here