Page MenuHomePhabricator

[keyserver] filter out communities that viewer is a member of or that aren't public
ClosedPublic

Authored by varun on Dec 23 2024, 7:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 8, 11:27 PM
Unknown Object (File)
Fri, Mar 28, 2:49 PM
Unknown Object (File)
Fri, Mar 28, 8:49 AM
Unknown Object (File)
Fri, Mar 28, 2:02 AM
Unknown Object (File)
Thu, Mar 27, 6:02 PM
Unknown Object (File)
Mon, Mar 24, 9:30 AM
Unknown Object (File)
Mar 21 2025, 5:32 PM
Unknown Object (File)
Mar 21 2025, 7:10 AM
Subscribers

Details

Summary

We don't want to leak private groups via this endpoint

Public = has a Farcaster channel tag association

https://linear.app/comm/issue/ENG-10023/only-return-communities-from-fetchallcommunityinfoswithnames-if-member

Depends on D14054

Test Plan

opened the directory and confirmed that only public communities of which i wasn't a member were displayed

joined some communities, closed the community drawer and then reopened drawer and directory; confirmed that the communities i had just joined were no longer visible in the directory

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun held this revision as a draft.
keyserver/src/fetchers/community-fetchers.js
107–109 ↗(On Diff #46598)

Let's make this change as discussed in 1:1

keyserver/src/fetchers/community-fetchers.js
97 ↗(On Diff #46598)

Can you find a better name for this?

99 ↗(On Diff #46598)

Instead of one query per community, let's have a single query that checks all of them. We can do this by calling checkThreads, or introducing a new helper that is similar to viewerIsMember, but can handle checking multiple communities at once in a single query (and calls checkThreads under the hood)

varun published this revision for review.Dec 23 2024, 9:17 PM
varun retitled this revision from [keyserver] filter out communities that viewer is not a member of and that aren't public to [keyserver] filter out communities that viewer is a member of or that aren't public.
varun edited the test plan for this revision. (Show Details)
varun edited the summary of this revision. (Show Details)
ashoat added inline comments.
keyserver/src/fetchers/community-fetchers.js
85 ↗(On Diff #46599)

Can we rename this to fetchTaggedNonMemberCommunityInfosWithNames?

97 ↗(On Diff #46599)

Can we move the filter for !!row.farcasterChannelID here, so we don't query for membership info on non-tagged communities?

This revision is now accepted and ready to land.Dec 24 2024, 10:18 AM

return communities that the member is a part of

ashoat added inline comments.
keyserver/src/fetchers/community-fetchers.js
85 ↗(On Diff #46606)

Let's rename to fetchCommunityInfosForNativeDrawer