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
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
Unknown Object (File)
Fri, Nov 8, 8:36 PM
Unknown Object (File)
Fri, Nov 8, 8:36 PM
Unknown Object (File)
Tue, Nov 5, 2:06 AM
Unknown Object (File)
Oct 4 2024, 11:08 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
Branch
jacek/permissions-fix
Lint
No Lint Coverage
Unit
No Test Coverage

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