Page MenuHomePhabricator

[keyserver] Use `threadIsWithBlockedUserOnlyWithoutAdminRoleCheck` instead of `threadFrozenDueToBlock` in `checkThreadsFrozen`
Needs RevisionPublic

Authored by atul on Fri, Jun 21, 2:39 PM.
Tags
None
Referenced Files
F2163808: D12543.id41737.diff
Mon, Jul 1, 9:14 PM
F2163245: D12543.id41738.diff
Mon, Jul 1, 7:36 PM
F2162185: D12543.id41737.diff
Mon, Jul 1, 2:04 PM
F2160932: D12543.id41735.diff
Mon, Jul 1, 10:40 AM
F2157558: D12543.id41624.diff
Mon, Jul 1, 2:05 AM
Unknown Object (File)
Sun, Jun 30, 2:45 AM
Unknown Object (File)
Sun, Jun 30, 1:09 AM
Unknown Object (File)
Thu, Jun 27, 5:00 PM
Subscribers
None

Details

Reviewers
ashoat
Summary

Context: https://linear.app/comm/issue/ENG-7249/update-checkthreadsfrozen

We do sequential fetchThreadInfos to get communityThreadInfos so we can determine whether there is an admin without "sketchy" CHANGE_ROLE permission check.


Depends on D12502

Test Plan

flow + set some breakpoints and observed correct behavior:

43c03c.png (360×1 px, 102 KB)

Diff Detail

Repository
rCOMM Comm
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.Fri, Jun 21, 2:39 PM

rebase outside of flow stack

ashoat requested changes to this revision.Mon, Jul 1, 12:59 PM

Concerned about community roots

keyserver/src/fetchers/thread-permission-fetchers.js
173 ↗(On Diff #41737)

Good to clarify it's an ID rather than a RawThreadInfo

173 ↗(On Diff #41737)

For a community root, threadInfo.community will be null

(In fact, that is the only case where threadInfo.community won't be set)

Two questions:

  1. How do we handle this check for community roots? It looks like it doesn't work currently
  2. Do we have any similar issues on the client side? I'm pretty sure threadInfo.community isn't set for community roots there either
200 ↗(On Diff #41737)

What happens if a thread has a community, but we fail to fetch it? It looks like we just assume that the chat has no admin?

Given that all threads on the keyserver either are community roots or have a community, I wonder if we should consider a case where we failed to fetch the community root to be a potential privacy check failure. What do you think?

This revision now requires changes to proceed.Mon, Jul 1, 12:59 PM