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
Unknown Object (File)
Thu, Nov 7, 1:00 AM
Unknown Object (File)
Fri, Nov 1, 8:00 PM
Unknown Object (File)
Fri, Oct 18, 3:37 PM
Unknown Object (File)
Fri, Oct 18, 3:37 PM
Unknown Object (File)
Fri, Oct 18, 3:37 PM
Unknown Object (File)
Fri, Oct 18, 3:36 PM
Unknown Object (File)
Fri, Oct 18, 6:55 AM
Unknown Object (File)
Sep 10 2024, 1:19 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka requested review of this revision.Jan 29 2024, 6:03 AM
lib/reducers/data-loaded-reducer.js
29 ↗(On Diff #36264)

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 ↗(On Diff #36264)

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 ↗(On Diff #36264)

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 ↗(On Diff #36264)

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 ↗(On Diff #36264)

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