Page MenuHomePhabricator

[lib] Remove logout / delete account / identity login logic from specific reducers
ClosedPublic

Authored by inka on Jan 29 2024, 5:44 AM.
Tags
None
Referenced Files
F3555522: D10868.diff
Thu, Dec 26, 11:02 PM
Unknown Object (File)
Wed, Dec 25, 2:45 AM
Unknown Object (File)
Wed, Dec 25, 2:45 AM
Unknown Object (File)
Wed, Dec 25, 2:45 AM
Unknown Object (File)
Wed, Dec 25, 2:45 AM
Unknown Object (File)
Wed, Dec 25, 2:45 AM
Unknown Object (File)
Mon, Dec 9, 4:32 AM
Unknown Object (File)
Nov 14 2024, 8:21 AM
Subscribers

Details

Summary

issue: ENG-6424
Removing logic handling logout and delete account actions from specific reducers, because now we are removing all this state in one place using resetUserSpecificStateOnIdentityActions (see D10860)
I didn't remove logic from the following reducers:

  • reduceCurrentUserInfo, because these actions set a new currentUserInfo
  • reduceReportStore, because we set some special values to enabledReports on those actions
  • reduceKeyserverStore, baceuse we have to handle Ashoat's keyserver in a special way
Test Plan

Tested that it's possible to log out and back in, and no errors show up. Tested that on logout success state is still cleared

Diff Detail

Repository
rCOMM Comm
Branch
inka/login_reducers
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka requested review of this revision.Jan 29 2024, 6:03 AM
lib/reducers/data-loaded-reducer.js
29

We want to keep this, because we don't want the user to have to wait to see the logout screen

lib/reducers/policies-reducer.js
49

We want to keep this, because we are setting dataLoaded to false on .started, and we don't want to display policies modals on the logout screen

lib/reducers/theme-reducer.js
35

We want to keep this, because we are setting dataLoaded to false on .started, so we want to also reset the theme

lib/reducers/theme-reducer.js
35

Hmmm... wouldn't that lead to some weird flickering on logout? When the user presses the logout button, it will flicker from the user-selected theme to the default theme, while the logout animation is running.

Why not remove this and let it happen on logOutActionTypes.success, to avoid the flickering? cc @ginsu

ginsu requested changes to this revision.Jan 30 2024, 10:39 PM

Looks good, let's just fix up the flickering issue

lib/reducers/theme-reducer.js
35

Yes on native there will be a flicker. We should use @ashoat's recommendation here.

This revision now requires changes to proceed.Jan 30 2024, 10:39 PM

Stop resetting theme on logOutActionTypes.started

thanks for fixing this!

This revision is now accepted and ready to land.Jan 31 2024, 10:23 AM