Page MenuHomePhabricator

[lib] introduce selected keyservers selector
ClosedPublic

Authored by ginsu on Oct 31 2023, 1:00 AM.
Tags
None
Referenced Files
F3354333: D9641.id32574.diff
Sat, Nov 23, 12:48 PM
F3354267: D9641.id32569.diff
Sat, Nov 23, 12:39 PM
F3353692: D9641.diff
Sat, Nov 23, 10:56 AM
Unknown Object (File)
Wed, Nov 20, 3:34 PM
Unknown Object (File)
Wed, Nov 20, 7:40 AM
Unknown Object (File)
Sun, Oct 27, 11:49 PM
Unknown Object (File)
Sun, Oct 27, 11:49 PM
Unknown Object (File)
Sun, Oct 27, 11:49 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
No Lint Coverage
Unit
No Test Coverage

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

When do we expect this to be undefined?

lib/types/keyserver-types.js
30

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

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

Ah yeah ok makes sense

address @rohan's comments + rebase before landing