HomePhabricator
Diffusion Comm e33a11e5af95

[lib] Fix messages disappearing from thick sidebars

Description

[lib] Fix messages disappearing from thick sidebars

Summary:
issue: ENG-9403
I considered using threadWatcher, but it seems like it has a different purpose:
Overall threadWatcher represents threads that are bing watched by the user. For thick sidebars we want to always receive all updates.
More datailed explanation:
threadWatcher is currently only used in the context of keyservers. It is used to listen for chat updates when the user is either

  1. viewing a chat they are not a member of (this is not possible in thick threads, other than sidebars. But for sidebars with this code we will be getting all updates anyway)
  2. viewing a list of sidebars / subchannels of a chat they are not a mamber of (this is not possible in thick threads)
  3. viewing settings of a chat they are not a member of (this is not possible in thick threads)

Then, keyserver specific actions, keyserver specific selector, and this reducer use the ids from thread watcher.

Test Plan:
Tested that if a user is a member of a thick thread but not a member of its sidebar, they receive this sidebars messages. Tested they receive updates (tested name update)
Tested that if a user is mamber of a thick sidebar and leaves it, the messages are not removed from the store.
Tested that if the user leaves the parent chat, the messages from the thick sidebar ARE removed (in the function, !!threadInfo condition is not satisfied)

Checked all places where threadWatcher is used and verified that none of them require changes for thick sidebars.

Reviewers: tomek, kamil

Reviewed By: tomek

Subscribers: ashoat

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

Details

Provenance
inkaAuthored on Oct 1 2024, 12:41 PM
ashoatCommitted on Oct 1 2024, 12:49 PM
Reviewer
tomek
Differential Revision
D13554: [lib] Fix messages disappearing from thick sidebars
Parents
rCOMM11b7e6f30eba: [lib] Stop processOutboundMessages loop when it becomes outdated
Branches
Unknown
Tags
Unknown