diff --git a/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js b/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js --- a/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js +++ b/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js @@ -71,6 +71,7 @@ +sessionID: ?string, +currentUserInfo: ?CurrentUserInfo, +isSocketConnected: boolean, + +sessionRecoveryInProgress: boolean, +lastCommunicatedPlatformDetails: ?PlatformDetails, }; type BindServerCallsParams = $ReadOnly<{ @@ -254,6 +255,7 @@ (params: ServerCallSelectorParams) => params.sessionID, (params: ServerCallSelectorParams) => params.currentUserInfo, (params: ServerCallSelectorParams) => params.isSocketConnected, + (params: ServerCallSelectorParams) => params.sessionRecoveryInProgress, (params: ServerCallSelectorParams) => params.lastCommunicatedPlatformDetails, ( @@ -263,6 +265,7 @@ sessionID: ?string, currentUserInfo: ?CurrentUserInfo, isSocketConnected: boolean, + sessionRecoveryInProgress: boolean, lastCommunicatedPlatformDetails: ?PlatformDetails, ) => bindCookieAndUtilsIntoCallSingleKeyserverEndpoint({ @@ -272,6 +275,7 @@ sessionID, currentUserInfo, isSocketConnected, + sessionRecoveryInProgress, lastCommunicatedPlatformDetails, keyserverID, }), diff --git a/lib/keyserver-conn/keyserver-call-infos.js b/lib/keyserver-conn/keyserver-call-infos.js --- a/lib/keyserver-conn/keyserver-call-infos.js +++ b/lib/keyserver-conn/keyserver-call-infos.js @@ -16,6 +16,7 @@ +urlPrefix: string, +sessionID: ?string, +isSocketConnected: boolean, + +sessionRecoveryInProgress: boolean, +lastCommunicatedPlatformDetails: ?PlatformDetails, }; @@ -27,6 +28,8 @@ (keyserverInfo: KeyserverInfoPartial) => keyserverInfo.sessionID, (keyserverInfo: KeyserverInfoPartial) => keyserverInfo.connection?.status === 'connected', + (keyserverInfo: KeyserverInfoPartial) => + !!keyserverInfo.connection?.sessionRecoveryInProgress, (keyserverInfo: KeyserverInfoPartial) => keyserverInfo.lastCommunicatedPlatformDetails, ( @@ -34,12 +37,14 @@ urlPrefix: string, sessionID: ?string, isSocketConnected: boolean, + sessionRecoveryInProgress: boolean, lastCommunicatedPlatformDetails: ?PlatformDetails, ) => ({ cookie, urlPrefix, sessionID, isSocketConnected, + sessionRecoveryInProgress, lastCommunicatedPlatformDetails, }), ); diff --git a/lib/selectors/server-calls.js b/lib/selectors/server-calls.js --- a/lib/selectors/server-calls.js +++ b/lib/selectors/server-calls.js @@ -21,6 +21,7 @@ +sessionID: ?string, +currentUserInfo: ?CurrentUserInfo, +isSocketConnected: ?boolean, + +sessionRecoveryInProgress: ?boolean, +lastCommunicatedPlatformDetails: ?PlatformDetails, }; @@ -50,6 +51,7 @@ connectionInfo?.status !== undefined ? connectionInfo?.status === 'connected' : undefined, + sessionRecoveryInProgress: connectionInfo?.sessionRecoveryInProgress, lastCommunicatedPlatformDetails, }), ); diff --git a/lib/utils/action-utils.js b/lib/utils/action-utils.js --- a/lib/utils/action-utils.js +++ b/lib/utils/action-utils.js @@ -40,11 +40,14 @@ return cachedNonOverridenBoundServerCall; } - const { urlPrefix, isSocketConnected } = serverCallState; + const { urlPrefix, isSocketConnected, sessionRecoveryInProgress } = + serverCallState; invariant( !!urlPrefix && isSocketConnected !== undefined && - isSocketConnected !== null, + isSocketConnected !== null && + sessionRecoveryInProgress !== undefined && + sessionRecoveryInProgress !== null, 'keyserver missing from keyserverStore', ); @@ -52,6 +55,7 @@ ...serverCallState, urlPrefix, isSocketConnected, + sessionRecoveryInProgress, dispatch, ...paramOverride, }); diff --git a/lib/utils/keyserver-call.js b/lib/utils/keyserver-call.js --- a/lib/utils/keyserver-call.js +++ b/lib/utils/keyserver-call.js @@ -77,6 +77,7 @@ urlPrefix, sessionID, isSocketConnected, + sessionRecoveryInProgress, lastCommunicatedPlatformDetails, } = keyserverCallInfos[keyserverID]; @@ -88,6 +89,7 @@ urlPrefix, sessionID, isSocketConnected, + sessionRecoveryInProgress, lastCommunicatedPlatformDetails, });