HomePhabricator
Diffusion Comm 0c1ab6440357

[lib][web][native] Refactor preRequestUserStateSelector

Description

[lib][web][native] Refactor preRequestUserStateSelector

Summary:
issue: https://linear.app/comm/issue/ENG-5379/refactor-prerequestuserstateselector
This selector is used to fetch PreRequestUserState. It is being used to be passed into setNewSession, deleteAccount and logOut actions.
setNewSession is always called in the context of one keyserver. logOut and deleteAccount may be called for one keyserver, or for many. PreRequestUserState is alway used for the same thing - invalidSessionDowngrade check (see https://linear.app/comm/issue/ENG-4685/refactor-selectors#comment-539ab029 for more details). So we want to pass into those actions an object of the same shape. But, if an action is called for one keyserver, we want to only include information about that keyserver. That's why I split the selector into two selectors.
invalidSessionDowngrade itself will be updated during https://linear.app/comm/issue/ENG-5351/refactor-web-reducer

Test Plan: Tested that the selectors work. Checked all places where preRequestUserStateSelector was being used and figured out what it was used for, and which of the new selectors needs to be used now

Reviewers: michal, kamil, ginsu

Reviewed By: kamil

Subscribers: ashoat, tomek, wyilio

Differential Revision: https://phab.comm.dev/D9729

Details

Provenance
inkaAuthored on Nov 6 2023, 8:59 AM
Reviewer
kamil
Differential Revision
D9729: [lib][web][native] Refactor preRequestUserStateSelector
Parents
rCOMM43e13d0d03c8: [lib][web][native] Refactor updatesCurrentAsOfSelector
Branches
Unknown
Tags
Unknown