Page MenuHomePhabricator

[lib] Extract invalidateKeyserverSession in useKeyserverRecoveryLogIn
ClosedPublic

Authored by ashoat on Mar 6 2024, 4:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 28, 1:11 PM
Unknown Object (File)
Sat, Dec 28, 1:11 PM
Unknown Object (File)
Sat, Dec 28, 1:10 PM
Unknown Object (File)
Sat, Dec 28, 1:09 PM
Unknown Object (File)
Thu, Dec 19, 4:03 AM
Unknown Object (File)
Dec 8 2024, 5:52 PM
Unknown Object (File)
Dec 7 2024, 9:02 AM
Unknown Object (File)
Dec 5 2024, 3:50 AM
Subscribers
None

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage