Page MenuHomePhabricator

[lib] Separate recovery types that are managed by KeyserverConnectionHandler
ClosedPublic

Authored by ashoat on Thu, Apr 18, 12:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 8:28 PM
Unknown Object (File)
Fri, Apr 26, 6:45 PM
Unknown Object (File)
Fri, Apr 26, 10:21 AM
Unknown Object (File)
Wed, Apr 24, 5:26 PM
Unknown Object (File)
Wed, Apr 24, 1:13 PM
Unknown Object (File)
Tue, Apr 23, 2:49 PM
Unknown Object (File)
Mon, Apr 22, 1:17 PM
Unknown Object (File)
Thu, Apr 18, 6:53 PM
Subscribers
None

Details

Summary

Most RecoveryActionSources are initiated by KeyserverConnectionHandler when they are placed into Redux. The exceptions are managed directly by the SQLiteDataHandler on native. Much of the code is shared and extracted to the utils in recovery-utils.js.

By splitting these types, we can improve type safety in several places. We can also add a second protection against triggering this invariant: we know that KeyserverConnectionHandler will check CurrentUserInfo before initiating, so the invariant is safe.

Depends on D11690

Test Plan

Make sure keyserver session recovery still works, and make sure that standard keyserver auth still works

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/shared/session-utils.js
93–100 ↗(On Diff #39240)

This is the most exciting change, but the type changes should help catch errors as well

lib/types/account-types.js
97 ↗(On Diff #39240)

Probably best to start reviewing from here

This revision is now accepted and ready to land.Fri, Apr 19, 4:49 AM