Page MenuHomePhabricator

[web][native] Create lists of fields that are not to be removed on identity actions
ClosedPublic

Authored by inka on Jan 26 2024, 9:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 4:59 PM
Unknown Object (File)
Thu, Nov 14, 1:54 PM
Unknown Object (File)
Thu, Nov 14, 7:52 AM
Unknown Object (File)
Fri, Nov 8, 10:14 AM
Unknown Object (File)
Fri, Nov 8, 9:28 AM
Unknown Object (File)
Thu, Nov 7, 1:09 AM
Unknown Object (File)
Oct 18 2024, 2:36 PM
Unknown Object (File)
Oct 18 2024, 2:36 PM
Subscribers

Details

Summary

issue: ENG-6424
Please see the notion dock in which I decribe the decission made for each field.

Test Plan

I will test this with the next diff, which will update the reducers. I will dispatch the actions, and check if the app baheves as expected. Puting this up now, because this a lot to thing through

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 26 2024, 10:03 AM
ashoat requested changes to this revision.Jan 27 2024, 3:36 PM
ashoat added inline comments.
native/redux/state-types.js
30 ↗(On Diff #36188)

I can't see how this gets used eventually, but I'm guessing that you will add some logic in the master reducer BEFORE it calls the other reducers, that will reset the state to defaultState EXCEPT this list? Then the other reducers will receive this "cleared" state as input, and the master reducer will return their output?

Asking because I want to make sure that fields like currentUserInfo don't need to be included here (they would if you were calling the other reducers BEFORE your new state-clearing logic).

33 ↗(On Diff #36188)

Since dataLoaded gets updated by the reducer for identity actions anyways, I don't think we need to include it in this list.

If the reducer updates the field anyways, we only need to know if the reducer needs to know the old value of the field. If the reducer doesn't need to know the old value of the field, then we can remove it from this list, to keep the list small and concise.

What do you think? Let me know if I'm missing anything

35 ↗(On Diff #36188)

I don't think we should include this. The notif permission alert maximum should be user-specific

43 ↗(On Diff #36188)

In the doc you say:

the identity doesn’t send us any policies yet, so we should just clear this data

If we want to clear this data, shouldn't it be removed from the list?

web/redux/redux-setup.js
69 ↗(On Diff #36188)

See above – I think we should remove

72 ↗(On Diff #36188)

See above – I think we should remove

74 ↗(On Diff #36188)

See above – I think we should remove

This revision now requires changes to proceed.Jan 27 2024, 3:36 PM

Remove notifPermissionAlertInfo, dataLoaded and userPolicies from the lists

native/redux/state-types.js
30 ↗(On Diff #36188)

Yes, this is the plan! Main reducers on web and native will clear the state apart from fields specified in this list. Then, this cleared state will continue on its way through these reducers, to master reducer, and to specific reducers.

currentUserInfo will be cleared, and then set by reduceCurrentUserInfo reducer.

33 ↗(On Diff #36188)

I think you are right. Since we won't be clearing the state on recovery logins, dataLoaded can be set to false by the clearing function.

43 ↗(On Diff #36188)

Yes, of course, sorry, this is a mistake

This revision is now accepted and ready to land.Jan 29 2024, 9:40 AM