diff --git a/lib/actions/siwe-actions.js b/lib/actions/siwe-actions.js --- a/lib/actions/siwe-actions.js +++ b/lib/actions/siwe-actions.js @@ -80,6 +80,7 @@ updatesCurrentAsOf: { [authoritativeKeyserverID()]: response.serverTime }, authActionSource: logInActionSources.logInFromNativeSIWE, notAcknowledgedPolicies: response.notAcknowledgedPolicies, + preRequestUserInfo: null, }; }; diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -567,6 +567,7 @@ authActionSource, calendarQuery, keyserverIDs: inputKeyserverIDs, + preRequestUserInfo, ...restLogInInfo } = logInInfo; @@ -655,6 +656,7 @@ authActionSource: logInInfo.authActionSource, notAcknowledgedPolicies: responses[authoritativeKeyserverID()].notAcknowledgedPolicies, + preRequestUserInfo, }; }; diff --git a/lib/selectors/account-selectors.js b/lib/selectors/account-selectors.js --- a/lib/selectors/account-selectors.js +++ b/lib/selectors/account-selectors.js @@ -29,10 +29,12 @@ createSelector( (state: BaseAppState<>) => state.navInfo, (state: BaseAppState<>) => state.calendarFilters, + (state: BaseAppState<>) => state.currentUserInfo, deviceTokensSelector, ( navInfo: BaseNavInfo, calendarFilters: $ReadOnlyArray, + currentUserInfo: ?CurrentUserInfo, deviceTokens: { +[keyserverID: string]: ?string }, ) => { const deviceTokenUpdateRequest: { [string]: DeviceTokenUpdateRequest } = @@ -52,6 +54,7 @@ filters: calendarFilters, }, deviceTokenUpdateRequest, + preRequestUserInfo: currentUserInfo, }; }, ); diff --git a/lib/types/account-types.js b/lib/types/account-types.js --- a/lib/types/account-types.js +++ b/lib/types/account-types.js @@ -138,6 +138,7 @@ +deviceTokenUpdateRequest: DeviceTokenUpdateInput, +signedIdentityKeysBlob?: SignedIdentityKeysBlob, +initialNotificationsEncryptedMessage?: string, + +preRequestUserInfo: ?CurrentUserInfo, }; export type LogInInfo = { @@ -193,6 +194,7 @@ +updatesCurrentAsOf: { +[keyserverID: string]: number }, +authActionSource: AuthActionSource, +notAcknowledgedPolicies?: $ReadOnlyArray, + +preRequestUserInfo: ?CurrentUserInfo, }; export type KeyserverAuthResult = { diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js --- a/native/redux/redux-setup.js +++ b/native/redux/redux-setup.js @@ -178,14 +178,14 @@ action.payload.sessionChange.currentUserInfo && invalidSessionRecovery( state, - action.payload.sessionChange.currentUserInfo, + action.payload.preRequestUserState?.currentUserInfo, action.payload.authActionSource, )) || ((action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success) && invalidSessionRecovery( state, - action.payload.currentUserInfo, + action.payload.preRequestUserInfo, action.payload.authActionSource, )) || (action.type === keyserverAuthActionTypes.success && diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -168,7 +168,7 @@ action.payload.sessionChange.currentUserInfo && invalidSessionRecovery( state, - action.payload.sessionChange.currentUserInfo, + action.payload.preRequestUserState?.currentUserInfo, action.payload.authActionSource, )) || (action.type === keyserverAuthActionTypes.success &&