Page MenuHomePhabricator

[lib] Refactor reduceMessageStore
ClosedPublic

Authored by inka on Jan 10 2024, 3:25 AM.
Tags
None
Referenced Files
F3388427: D10589.id35462.diff
Fri, Nov 29, 2:17 PM
Unknown Object (File)
Tue, Nov 26, 3:34 AM
Unknown Object (File)
Tue, Nov 26, 1:37 AM
Unknown Object (File)
Wed, Nov 6, 12:44 PM
Unknown Object (File)
Tue, Nov 5, 4:12 PM
Unknown Object (File)
Tue, Nov 5, 3:55 PM
Unknown Object (File)
Tue, Nov 5, 3:54 PM
Unknown Object (File)
Oct 22 2024, 9:14 PM
Subscribers

Details

Summary

issue: ENG-5821
On identity login we want to remove old messages from the store. Identity doesn't return any messages, so messageInfos, truncationStatus and currentAsOf are empty
threadInfos come from thread reducer, which will be udated to remove all threads on identity login

Test Plan

Tested that if a user is logged in to the app, and connected to Ashoat's keyserver, and then logs in to another keserver using keyserverAuthActionTypes, the new messages provided by this keyserver are saved in the message store (if the corresponding thread was saved in the thread store)
Tested that if tempIdentityLoginActionTypes.success is dispatched, the messages in the message store get wiped.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Jan 10 2024, 3:58 AM
michal added inline comments.
lib/reducers/message-reducer.js
752 ↗(On Diff #35462)

Web redux default state has currentAsOf: { [ashoatKeyserverID]: 0 }. I assume that's ok for now, and it will be removed from default state after we switch to using these actions?

This revision is now accepted and ready to land.Jan 11 2024, 7:57 AM
lib/reducers/message-reducer.js
752 ↗(On Diff #35462)

For now Ashoat's keyserver has to stay in the store at all times, so this needs to be fixed. Thanks for catching this!

Fix currentAsOf. Made a note in ENG-5800 to update this when default state is updated

This revision was automatically updated to reflect the committed changes.