HomePhabricator
Diffusion Comm caf1601b898e

[lib] Fix useThreadsWithPermission check

Description

[lib] Fix useThreadsWithPermission check

Summary:
This check is currently equivalent to a threadTypeIsCommunityRoot check. I initially gleaned this by reading the code, but I verified it by comparing the two checks for each thread in my ThreadStore on production. The reason is that communityRootMembersToRole only contains entries for community roots, and all community roots have at least one admin.

This is probably the wrong check for us to making here. We should probably treat the channels inside the community root the same as we treat the community. Additionally, we should probably carve out an exception for channels inside GENESIS, which we generally treat the same as thick threads (for the purposes of determining whether to freeze the chat due to there being only one other member, and that member has blocked you).

Depends on D13874

Test Plan: I deployed a custom environment to comm.software where I could run React profiling on the production dataset as described here. I confirmed this change reduced rerender time from 3.0s to 0.5s

Reviewers: tomek, angelika

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D13886

Details

Provenance
ashoatAuthored on Nov 5 2024, 7:08 PM
Reviewer
tomek
Differential Revision
D13886: [lib] Fix useThreadsWithPermission check
Parents
rCOMMe17a45b3ef95: [lib] Avoid creating new array on every invocation of useThreadHasPermission
Branches
Unknown
Tags
Unknown