Page MenuHomePhabricator

[lib] Refactor user reducer
ClosedPublic

Authored by inka on Jan 15 2024, 3:27 AM.
Tags
None
Referenced Files
F3525695: D10628.id36276.diff
Mon, Dec 23, 6:10 PM
F3525694: D10628.id36229.diff
Mon, Dec 23, 6:10 PM
F3525693: D10628.id35771.diff
Mon, Dec 23, 6:10 PM
F3525691: D10628.id35923.diff
Mon, Dec 23, 6:10 PM
F3525690: D10628.id35607.diff
Mon, Dec 23, 6:10 PM
F3525685: D10628.id.diff
Mon, Dec 23, 6:09 PM
F3525682: D10628.diff
Mon, Dec 23, 6:09 PM
Unknown Object (File)
Sun, Dec 22, 12:38 AM
Subscribers

Details

Summary

issue: ENG-5815
When we log in to a keyserver, we get the list of its users. But as we disconnect from a keyserver (remove it from the list of connected keyservers) we don't want to remove the users from our store - we might still want to be able to talk to users we got to know about.

Removing them from our store when we disconnect from a common keyserver would be quite complicated, because we might have other common keyservers. For now we just leave the users in the store.

Delete account and logout actions will not be refactored any further, so we want to keep the old behaviour as is if not using CSAT

Test Plan

Tested that if KEYSERVER_AUTH_SUCCESS is dispatched with a new user in userInfos, this user is added to the store, and no users are deleted. Tested that when the user logs out of the app, all users are sill removed from the store

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Jan 15 2024, 3:46 AM
michal added inline comments.
lib/reducers/user-reducer.js
290–292 ↗(On Diff #35607)

Is there a reason why we are spreading this?

This revision is now accepted and ready to land.Jan 16 2024, 7:14 AM
lib/reducers/user-reducer.js
220–222 ↗(On Diff #35607)

As mentioned in other diffs, not sure if we need to change anything for logOutActionTypes.success

inka planned changes to this revision.Jan 17 2024, 8:51 AM

We decided to have a single action for logging out of keyservers and identity.

This revision is now accepted and ready to land.Jan 18 2024, 1:47 AM
inka requested review of this revision.Jan 18 2024, 1:47 AM

Merge identity delete account with keyserver delete account

This revision is now accepted and ready to land.Jan 24 2024, 11:26 AM
michal added inline comments.
lib/reducers/user-reducer.js
244–249 ↗(On Diff #35923)

Can we merge the conditionals like in report reducer?

This revision was automatically updated to reflect the committed changes.