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 @@ -42,10 +42,7 @@ import { nonThreadCalendarFilters } from '../selectors/calendar-filter-selectors.js'; import { queueActivityUpdatesActionType } from '../types/activity-types.js'; import { defaultCalendarQuery } from '../types/entry-types.js'; -import type { - KeyserverInfos, - KeyserverStore, -} from '../types/keyserver-types.js'; +import type { KeyserverStore } from '../types/keyserver-types.js'; import type { BaseAction } from '../types/redux-types.js'; import { fullStateSyncActionType, @@ -58,35 +55,8 @@ import { processUpdatesActionType } from '../types/update-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; import { getConfig } from '../utils/config.js'; -import { getMessageForException } from '../utils/errors.js'; -import { assertObjectsAreEqual } from '../utils/objects.js'; import { setURLPrefix } from '../utils/url-utils.js'; -function assertKeyserverStoresAreEqual( - processedKeyserverStore: KeyserverInfos, - expectedKeyserverStore: KeyserverInfos, - location: string, - onStateDifference?: (message: string) => mixed, -) { - try { - assertObjectsAreEqual( - processedKeyserverStore, - expectedKeyserverStore, - `KeyserverInfos - ${location}`, - ); - } catch (e) { - console.log( - 'Error processing KeyserverStore ops', - processedKeyserverStore, - expectedKeyserverStore, - ); - const message = `Error processing KeyserverStore ops ${ - getMessageForException(e) ?? '{no exception message}' - }`; - onStateDifference?.(message); - } -} - function shouldClearDeviceToken( state: KeyserverStore, payload: @@ -110,7 +80,6 @@ export default function reduceKeyserverStore( state: KeyserverStore, action: BaseAction, - onStateDifference?: (message: string) => mixed, ): { keyserverStore: KeyserverStore, keyserverStoreOperations: $ReadOnlyArray, @@ -686,16 +655,22 @@ keyserverStoreOperations: [operation], }; } else if (action.type === setClientDBStoreActionType) { - // Once the functionality is confirmed to work correctly, - // we will proceed with returning keyserverInfos from the payload. - assertKeyserverStoresAreEqual( - action.payload.keyserverInfos ?? {}, - state.keyserverInfos, - action.type, - onStateDifference, - ); + const newKeyserverInfos = action.payload.keyserverInfos; + + if (!newKeyserverInfos) { + return { + keyserverStore: state, + keyserverStoreOperations: [], + }; + } + + const newKeyserverStore: KeyserverStore = { + ...state, + keyserverInfos: newKeyserverInfos, + }; + return { - keyserverStore: state, + keyserverStore: newKeyserverStore, keyserverStoreOperations: [], }; } else if (action.type === updateCalendarQueryActionTypes.success) { diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js --- a/lib/reducers/master-reducer.js +++ b/lib/reducers/master-reducer.js @@ -95,7 +95,6 @@ let { keyserverStore, keyserverStoreOperations } = reduceKeyserverStore( state.keyserverStore, action, - onStateDifferenceForStaff, ); if ( diff --git a/native/redux/handle-redux-migration-failure.js b/native/redux/handle-redux-migration-failure.js --- a/native/redux/handle-redux-migration-failure.js +++ b/native/redux/handle-redux-migration-failure.js @@ -24,6 +24,7 @@ 'inviteLinksStore', 'integrityStore', 'communityStore', + 'keyserverStore', ]; function handleReduxMigrationFailure(oldState: AppState): AppState { diff --git a/web/redux/handle-redux-migration-failure.js b/web/redux/handle-redux-migration-failure.js --- a/web/redux/handle-redux-migration-failure.js +++ b/web/redux/handle-redux-migration-failure.js @@ -10,7 +10,6 @@ 'enabledApps', 'alertStore', 'commServicesAccessToken', - 'keyserverStore', 'globalThemeInfo', 'customServer', 'messageStore',