Page MenuHomePhabricator

[lib] Refactor reduceMessageStore
ClosedPublic

Authored by inka on Jan 10 2024, 3:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 9:14 PM
Unknown Object (File)
Wed, Oct 16, 3:26 AM
Unknown Object (File)
Wed, Oct 16, 3:26 AM
Unknown Object (File)
Wed, Oct 16, 3:26 AM
Unknown Object (File)
Wed, Oct 16, 3:25 AM
Unknown Object (File)
Wed, Oct 16, 3:25 AM
Unknown Object (File)
Oct 4 2024, 9:40 AM
Unknown Object (File)
Oct 2 2024, 8:06 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.