diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js --- a/lib/reducers/keyserver-reducer.js +++ b/lib/reducers/keyserver-reducer.js @@ -135,6 +135,10 @@ keyserverInfo: { ...state.keyserverInfos[keyserverID], cookie: null, + connection: { + ...state.keyserverInfos[keyserverID].connection, + sessionRecoveryInProgress: false, + }, }, }, }); @@ -160,17 +164,16 @@ }; } - let newKeyserverInfo = { - ...state.keyserverInfos[keyserverID], - }; - let keyserverUpdated = false; - + let newKeyserverInfo = state.keyserverInfos[keyserverID]; if (sessionChange.cookie !== undefined) { newKeyserverInfo = { ...newKeyserverInfo, cookie: sessionChange.cookie, + connection: { + ...newKeyserverInfo.connection, + sessionRecoveryInProgress: false, + }, }; - keyserverUpdated = true; } if (sessionChange.cookieInvalidated) { newKeyserverInfo = { @@ -186,24 +189,10 @@ queuedActivityUpdates: [], }, }; - keyserverUpdated = true; - } - if ( - state.keyserverInfos[keyserverID].connection.sessionRecoveryInProgress && - (gotUserCookie || sessionChange.cookieInvalidated) - ) { - newKeyserverInfo = { - ...newKeyserverInfo, - connection: { - ...newKeyserverInfo.connection, - sessionRecoveryInProgress: false, - }, - }; - keyserverUpdated = true; } const operations: ReplaceKeyserverOperation[] = []; - if (keyserverUpdated) { + if (newKeyserverInfo !== state.keyserverInfos[keyserverID]) { operations.push({ type: 'replace_keyserver', payload: { @@ -246,6 +235,7 @@ connection: { ...state.keyserverInfos[keyserverID].connection, connectionIssue: null, + sessionRecoveryInProgress: false, }, }, }, @@ -495,6 +485,7 @@ connection: { ...oldConnection, connectionIssue: null, + sessionRecoveryInProgress: false, queuedActivityUpdates: [], lateResponses: [], }, @@ -529,6 +520,7 @@ connection: { ...oldConnection, connectionIssue: null, + sessionRecoveryInProgress: false, queuedActivityUpdates: [], lateResponses: [], },