Page MenuHomePhabricator

[native, lib] Move resetUserStateActionType to lib
ClosedPublic

Authored by inka on Jul 18 2023, 11:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 2:12 AM
Unknown Object (File)
Sat, Oct 12, 5:23 AM
Unknown Object (File)
Oct 4 2024, 4:30 AM
Unknown Object (File)
Sep 26 2024, 3:38 AM
Unknown Object (File)
Sep 23 2024, 3:59 AM
Unknown Object (File)
Sep 14 2024, 6:00 PM
Unknown Object (File)
Sep 12 2024, 7:19 PM
Unknown Object (File)
Sep 12 2024, 7:19 PM
Subscribers

Details

Summary

As mentioned in https://linear.app/comm/issue/ENG-4377/refactor-cookie-field-in-web-redux I need to move resetUserStateActionType to lib, because the cookie filed will be in the KesyerveStore, that will be in BaseAppState, so it makes
sense it be reduced by a reducer from lib. And resetUserStateActionType influences the cookie field in redux-setup.js. Since the action will now be in lib, we can move the logic that reduces CurrentUserInfo when this action is called
to lib as well

Test Plan

ran yarn flow all. Checked that resetUserStateActionType is not reduced anywhere else.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/redux/redux-setup.js
331–340

This had to be moved here, because now we don't want to return from this if, we need to assign state and let it continue to baseReducer. And if we do that in the if else above, then flow is not sure about the action type and shows errors

inka requested review of this revision.Jul 18 2023, 11:58 AM
michal added inline comments.
lib/actions/user-actions.js
323

Nit: I think we prefer exporting at the end of the file instead of inline

lib/types/redux-types.js
1171

Any reason for adding void payload here?

This revision is now accepted and ready to land.Jul 19 2023, 3:09 AM

Address review

lib/types/redux-types.js
1171

It is required by flow