HomePhabricator
Diffusion Comm 246557e54623

[lib] Add `ThreadActivityStore` to Redux

Tags
None
Referenced Files
F769289: 3f708c.png
Sep 25 2023, 1:10 PM
File Not Attached
Subscribers
None

Description

[lib] Add ThreadActivityStore to Redux

Summary:
As described on Linear (https://linear.app/comm/issue/ENG-4866/improve-performance-of-re-rendering-chat-list-and-thread-list#comment-e78e87ae), moving lastNavigatedTo and lastPruned out of MessageStore.threads will lead to performance improvements. It also generally decouples the actual MessageStore.threads "content" from information tracked/persisted solely for the purpose of pruning.

Here's a rough plan for the stack:

  1. Introduce ThreadActivityStore
  2. Got through every scenario where lastNavigatedTo or lastPruned are updated and ensure we're updating ThreadActivityStore in the same way.
  3. Modify ThreadPruner to pull from ThreadActivityStore instead of MessageStore.messages (Set to a couple seconds instead of 6 hours to "force" it)
  4. Deprecate MessageStore.threads[threadID].[lastNavigatedTo/lastPruned] and introduce a Redux migration that maps previous vaues in MessageStore.threads to ThreadActivityStore.

Test Plan:
Used Redux dev tools to ensure that threadActivityStore was as expected. Ensured that it updated along with MessageStore.threads on updateThreadLastNavigatedActionType:

3f708c.png (530×1 px, 71 KB)

Reviewers: ashoat, ginsu, tomek, rohan, kamil

Reviewed By: ashoat

Subscribers: michal

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

Details

Provenance
atulAuthored on Sep 25 2023, 12:51 PM
Reviewer
ashoat
Differential Revision
D9262: [lib] Add `ThreadActivityStore` to Redux
Parents
rCOMMd81b7f7ca955: [native] update password client method and CommRustModule implementation
Branches
Unknown
Tags
Unknown