Page MenuHomePhabricator

[lib] Fix messages disappearing from thick sidebars
ClosedPublic

Authored by inka on Oct 1 2024, 2:45 AM.
Tags
None
Referenced Files
F3527406: D13554.diff
Tue, Dec 24, 5:01 AM
Unknown Object (File)
Sat, Dec 21, 1:51 AM
Unknown Object (File)
Wed, Dec 18, 8:38 AM
Unknown Object (File)
Wed, Dec 18, 8:37 AM
Unknown Object (File)
Wed, Dec 18, 8:37 AM
Unknown Object (File)
Sun, Nov 24, 10:01 PM
Unknown Object (File)
Sun, Nov 24, 8:04 PM
Unknown Object (File)
Nov 22 2024, 4:32 PM
Subscribers

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Oct 1 2024, 5:27 AM
tomek added inline comments.
lib/reducers/message-reducer.js
148 ↗(On Diff #44740)

Can we make this more generic and test whether threadTypeIsThick?

This revision is now accepted and ready to land.Oct 1 2024, 5:36 AM
This revision was landed with ongoing or failed builds.Oct 1 2024, 12:49 PM
This revision was automatically updated to reflect the committed changes.