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)
Thu, Apr 25, 7:23 AM
Unknown Object (File)
Apr 8 2024, 2:51 AM
Unknown Object (File)
Mar 30 2024, 2:51 PM
Unknown Object (File)
Mar 18 2024, 1:28 AM
Unknown Object (File)
Mar 16 2024, 11:22 PM
Unknown Object (File)
Mar 15 2024, 7:58 PM
Unknown Object (File)
Mar 14 2024, 7:43 PM
Unknown Object (File)
Mar 13 2024, 3:15 PM
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
Lint Not Applicable
Unit
Tests Not Applicable