Page MenuHomePhabricator

[lib] Refactor user reducer
ClosedPublic

Authored by inka on Jan 15 2024, 3:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 8:52 PM
Unknown Object (File)
Tue, Nov 19, 8:13 PM
Unknown Object (File)
Tue, Nov 19, 3:51 AM
Unknown Object (File)
Mon, Nov 18, 9:04 PM
Unknown Object (File)
Mon, Nov 18, 7:55 PM
Unknown Object (File)
Mon, Nov 18, 7:42 PM
Unknown Object (File)
Mon, Nov 18, 7:25 PM
Unknown Object (File)
Thu, Nov 7, 5:36 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
No Lint Coverage
Unit
No Test Coverage

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

Can we merge the conditionals like in report reducer?

This revision was automatically updated to reflect the committed changes.