metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

Do not reconnect to older sessions when requesting a new wallet connect session

Open tommasini opened this issue 3 years ago • 4 comments

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

tommasini avatar Aug 15 '22 17:08 tommasini

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.

github-actions[bot] avatar Aug 15 '22 17:08 github-actions[bot]

It's WIP

tommasini avatar Aug 16 '22 10:08 tommasini

Sorry @tommasini , we've been very bad lol image

andreahaku avatar Sep 09 '22 15:09 andreahaku

@andreahaku You guys have been awesome ❤️

tommasini avatar Sep 12 '22 14:09 tommasini

Closing this PR because was merged here

tommasini avatar Sep 29 '22 13:09 tommasini