Page MenuHomePhabricator

[lib] introduce selected keyservers selector
ClosedPublic

Authored by ginsu on Oct 31 2023, 1:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 26, 4:03 AM
Unknown Object (File)
Nov 27 2024, 9:16 AM
Unknown Object (File)
Nov 27 2024, 5:57 AM
Unknown Object (File)
Nov 24 2024, 9:43 PM
Unknown Object (File)
Nov 23 2024, 12:48 PM
Unknown Object (File)
Nov 23 2024, 12:39 PM
Unknown Object (File)
Nov 23 2024, 10:56 AM
Unknown Object (File)
Nov 20 2024, 3:34 PM
Subscribers

Details

Summary

In order to populate the list of selected keyservers the user has added, we need to introduce this selector which selects all the keyserver infos in the keyserver store and additionally appends the keyserver admin username

Linear task: https://linear.app/comm/issue/ENG-5370/introduce-connected-keyservers-selector

Depends on D9639

Test Plan

Logged out the result of the selector and got the following (the second keyserver is just a test "dummy" keyserver I added to the keyserver store when testing the add keyserver flow)

Screenshot 2023-10-31 at 4.03.18 AM.png (1×1 px, 170 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu added reviewers: inka, michal, rohan.
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)
ginsu requested review of this revision.Oct 31 2023, 1:46 AM

Seems reasonable

lib/selectors/keyserver-selectors.js
69–71 ↗(On Diff #32518)

When do we expect this to be undefined?

lib/types/keyserver-types.js
30 ↗(On Diff #32518)

Doesn't matter but I think this is a singular SelectedKeyserverInfo

This revision is now accepted and ready to land.Oct 31 2023, 6:47 AM
lib/selectors/keyserver-selectors.js
69–71 ↗(On Diff #32518)

We really should always have this, but the username in UserInfo is optional

https://github.com/CommE2E/comm/blob/master/lib/types/user-types.js#L34-L39

In the CommunityPill component we also do something similar where if the keyserver admin username is not defined we return undefined, and that is where I got my idea for this implementation

https://github.com/CommE2E/comm/blob/master/native/components/community-pill.react.js#L27-L29

lib/selectors/keyserver-selectors.js
69–71 ↗(On Diff #32518)

Ah yeah ok makes sense

address @rohan's comments + rebase before landing