HomePhabricator
Diffusion Comm a3aef35f71b5

[lib] Extract invalidateKeyserverSession in useKeyserverRecoveryLogIn

Description

[lib] Extract invalidateKeyserverSession in useKeyserverRecoveryLogIn

Summary: In the next diff, I'll add some code that will call logOut in this newly extracted callback. Instead of repeating it, I decided to extract it to a single place first.

Test Plan:
This diff is a simple refactor. In addition to the following test plan I used for the next diff, I also made sure that Flow/ESLint were satisfied with the refactor.

  • I hacked legacy-recover-keyserver-session.js to use the wrong password so the session recovery would fail
  • I started the iOS simulator and logged in using a test user
  • I opened the Redux Dev Tools
  • I deleted the test user's cookie from the MariaDB database: DELETE FROM cookies WHERE user = 6390578 AND platform = 'ios'
  • I sent a message as the test user
  • I confirmed that session recovery was triggered in the Redux dev tools
  • I confirmed that after session recovery failed, the user was logged out in the UI
  • Via Redux dev tools, I confirmed that after session recovery failed, LOG_OUT_STARTED and LOG_OUT_SUCCESS were dispatched

Reviewers: inka, tomek

Reviewed By: inka

Differential Revision: https://phab.comm.dev/D11264

Details

Provenance
ashoatAuthored on Mar 6 2024, 4:06 PM
Reviewer
inka
Differential Revision
D11264: [lib] Extract invalidateKeyserverSession in useKeyserverRecoveryLogIn
Parents
rCOMMc40428a2d017: [lib] Don't sync users with non-authoritative keyservers
Branches
Unknown
Tags
Unknown