Page MenuHomePhabricator

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

Authored by varun on Mon, Dec 23, 7:56 AM.
Tags
None
Referenced Files
F3527457: D14181.id46599.diff
Tue, Dec 24, 5:06 AM
F3527455: D14181.id46598.diff
Tue, Dec 24, 5:06 AM
F3527441: D14181.id.diff
Tue, Dec 24, 5:06 AM
F3527434: D14181.diff
Tue, Dec 24, 5:05 AM
Subscribers

Details

Reviewers
ashoat
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
Branch
directory (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

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.Mon, Dec 23, 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

Can we rename this to fetchTaggedNonMemberCommunityInfosWithNames?

97

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.Tue, Dec 24, 10:18 AM