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 @@ -125,8 +125,9 @@ }; } else if (action.type === setNewSessionActionType) { const { keyserverID, sessionChange } = action.payload; + const gotUserCookie = sessionChange.cookie?.startsWith('user='); if (!state.keyserverInfos[keyserverID]) { - if (sessionChange.cookie?.startsWith('user=')) { + if (gotUserCookie) { console.log( 'received sessionChange with user cookie, ' + `but keyserver ${keyserverID} is not in KeyserverStore!`, @@ -160,6 +161,19 @@ }; 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) {