HomePhabricator
Diffusion Comm 581f71cd93ec

lib] Refactor message reducer

Description

lib] Refactor message reducer

Summary:
issue: ENG-5766
MessageStore looks like this:

export type MessageStore = {
  +messages: { +[id: string]: RawMessageInfo },
  +threads: MessageStoreThreads,
  +local: { +[id: string]: LocalMessageInfo },
  +currentAsOf: { +[keyserverID: string]: number },
};

messages, local and threads are filtered by updateMessageStoreWithLatestThreadInfos/processMessageStoreOperations based on what threads were removed by thread reducer. I only need to update currentAsOf.

Test Plan: Tested that if a user logs out of one keyserver all data related to this keyserver is wiped from MessageStore

Reviewers: michal, kamil, ginsu

Reviewed By: michal

Subscribers: ashoat, tomek

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

Details

Provenance
inkaAuthored on Jan 16 2024, 7:32 AM
Reviewer
michal
Differential Revision
D10653: lib] Refactor message reducer
Parents
rCOMM2ffa6b79192d: [lib] Refactor logout in reduceEntryInfos
Branches
Unknown
Tags
Unknown