Page MenuHomePhabricator

[lib] Fix `getPotentialMemberItems` to match server logic for adding users to threads in community
ClosedPublic

Authored by jacek on Aug 2 2022, 8:28 AM.
Tags
None
Referenced Files
F3396520: D4711.diff
Sun, Dec 1, 1:00 PM
Unknown Object (File)
Fri, Nov 29, 12:54 PM
Unknown Object (File)
Fri, Nov 29, 11:51 AM
Unknown Object (File)
Fri, Nov 29, 11:40 AM
Unknown Object (File)
Sat, Nov 9, 11:38 AM
Unknown Object (File)
Fri, Nov 8, 8:36 PM
Unknown Object (File)
Fri, Nov 8, 8:36 PM
Unknown Object (File)
Fri, Nov 8, 8:36 PM

Details

Summary

Adjust getPotentialMemberItems logic to match permissions on server side.
Linear issue: https://linear.app/comm/issue/ENG-1200/creating-thread-with-non-friend-user-is-blocked-on-front-end-and

Test Plan

Tested the change by trying to add friends/non-friends to community root/community [open|secret] subchannel/sidebars. It is possible to add any community member to community subchannel, and only friends to community.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jacek held this revision as a draft.
ashoat requested changes to this revision.Aug 3 2022, 7:04 AM
ashoat added inline comments.
lib/shared/search-utils.js
35–36 ↗(On Diff #15251)

Seeing this logic duplicated here is concerning. I looked into how we determine this on the keyserver side, and found that it boils down to the function getContainingThreadID in lib.

Can we make sure to use the same codepath here? That function returns an ID instead of a ThreadInfo, but I'm sure there's a way to avoid duplicating the logic.

This revision now requires changes to proceed.Aug 3 2022, 7:04 AM

This looks great!!

lib/shared/search-utils.js
158 ↗(On Diff #15313)

I don't think the double negation is necessary on parentThreadInfo

This revision is now accepted and ready to land.Aug 5 2022, 9:03 AM