diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -116,9 +116,13 @@ return currentUserInfo; } } else if ( - action.type === incrementalStateSyncActionType || - action.type === processUpdatesActionType + (action.type === incrementalStateSyncActionType || + action.type === processUpdatesActionType) && + relyingOnAuthoritativeKeyserver ) { + if (action.payload.keyserverID !== authoritativeKeyserverID()) { + return state; + } return action.payload.updatesResult.newUpdates.reduce( (reducedState, update) => { const { reduceCurrentUser } = updateSpecs[update.type]; @@ -128,7 +132,13 @@ }, state, ); - } else if (action.type === processServerRequestsActionType) { + } else if ( + action.type === processServerRequestsActionType && + relyingOnAuthoritativeKeyserver + ) { + if (action.payload.keyserverID !== authoritativeKeyserverID()) { + return state; + } const checkStateRequest = action.payload.serverRequests.find( candidate => candidate.type === serverRequestTypes.CHECK_STATE, ); @@ -371,9 +381,13 @@ ]; } } else if ( - action.type === incrementalStateSyncActionType || - action.type === processUpdatesActionType + (action.type === incrementalStateSyncActionType || + action.type === processUpdatesActionType) && + relyingOnAuthoritativeKeyserver ) { + if (action.payload.keyserverID !== authoritativeKeyserverID()) { + return [state, [], []]; + } const newUserInfos = _keyBy(userInfo => userInfo.id)( action.payload.userInfos, ); @@ -412,7 +426,13 @@ userStoreOps, ]; } - } else if (action.type === processServerRequestsActionType) { + } else if ( + action.type === processServerRequestsActionType && + relyingOnAuthoritativeKeyserver + ) { + if (action.payload.keyserverID !== authoritativeKeyserverID()) { + return [state, [], []]; + } const checkStateRequest = action.payload.serverRequests.find( candidate => candidate.type === serverRequestTypes.CHECK_STATE, );