HomePhabricator
Diffusion Comm 56bb0af60171

[lib] Fix leaving thread logic

Description

[lib] Fix leaving thread logic

Summary:
The logic had a couple of issues:

  1. We weren't checking the timestamps when the viewer was leaving a top-level thread
  2. We were checking top-level thread membership of the viewer, which doesn't make sense because it is guaranteed
  3. We weren't removing non-viewer users from sidebars while leaving their parent thread

https://linear.app/comm/issue/ENG-9452/remove-user-from-sidebars-when-they-leave-a-parent-thread

Test Plan:

  1. Create a thick thread and a sidebar with two users. Leave the parent thread as one user and verify that the user was removed from both threads.
  2. Create a thick thread and a sidebar with two users. Log in as the same user on two devices. Open the sidebar on one device and leave the parent thread on the other. An alert about chat invalidation should appear and both threads shouldn't be visible in the UI.

Reviewers: kamil, inka

Reviewed By: inka

Subscribers: ashoat

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

Details

Provenance
tomekAuthored on Oct 4 2024, 9:02 AM
Reviewer
inka
Differential Revision
D13614: [lib] Fix leaving thread logic
Parents
rCOMMde679c3c4910: [lib] Make Blob service facts types more strict
Branches
Unknown
Tags
Unknown