[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
- 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)
- viewing a list of sidebars / subchannels of a chat they are not a mamber of (this is not possible in thick threads)
- 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