HomePhabricator
Diffusion Comm 64434275ba45

[lib][native] Handle invalidSessionRecovery for keyserver auth

Description

[lib][native] Handle invalidSessionRecovery for keyserver auth

Summary:
issue: ENG-6358
invalidSessionRecovery is supposed to prevent logout being overriden by old session recovery
See the original diff introducing invalidSessionRecovery: D183

Currently we cross reference the currentUserInfo in state and action payload. But in the new login flow, the currentUserInfo may not be included in the action - and in the future it will definitely not be included.
We will instead check if the current user info is the same as the one the action was called for. This is similar to how PreRequestUserState is used right above for logout, to check if the logout action is not trying to override a newer valid session

Test Plan:
Tested that if keyserverAuthActionTypes.success is dispatched for socketAuthErrorResolutionAttempt with the same user id in action.payload.preRequestUserInfo as is currently in the store, the code proceeds to next reducers
Tested that if keyserverAuthActionTypes.success is dispatched for socketAuthErrorResolutionAttempt with a differrent user id in action.payload.preRequestUserInfo then is currently in the store, the current state is returned

Reviewers: michal, kamil, varun, ginsu

Reviewed By: michal

Subscribers: ashoat, tomek

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

Details

Provenance
inkaAuthored on Jan 10 2024, 3:40 AM
Reviewer
michal
Differential Revision
D10590: [lib][native] Handle invalidSessionRecovery for keyserver auth
Parents
rCOMM488d2f71605a: [lib] Refactor reduceMessageStore
Branches
Unknown
Tags
Unknown