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 @@ -86,12 +86,7 @@ // Only allow checkpoints to increase if we are connected // or if the action is a STATE_SYNC const { messageStoreOperations, messageStore: reducedMessageStore } = - reduceMessageStore( - state.messageStore, - action, - threadInfos, - onStateDifferenceForStaff, - ); + reduceMessageStore(state.messageStore, action, threadInfos); let messageStore = reducedMessageStore; let { keyserverStore, keyserverStoreOperations } = reduceKeyserverStore( diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -110,9 +110,7 @@ type ClientUpdateInfo, processUpdatesActionType, } from '../types/update-types.js'; -import { getMessageForException } from '../utils/errors.js'; import { translateClientDBThreadMessageInfos } from '../utils/message-ops-utils.js'; -import { assertObjectsAreEqual } from '../utils/objects.js'; const _mapValuesWithKeys = _mapValues.convert({ cap: false }); @@ -145,31 +143,6 @@ ); } -function assertMessageStoreLocalMessageInfosAreEqual( - processedMessageStore: MessageStore, - expectedMessageStore: MessageStore, - location: string, - onStateDifference?: (message: string) => mixed, -) { - try { - assertObjectsAreEqual( - processedMessageStore.local, - expectedMessageStore.local, - `MessageStore.local - ${location}`, - ); - } catch (e) { - console.log( - 'Error processing MessageStore local ops', - processedMessageStore.local, - expectedMessageStore.local, - ); - const message = `Error processing MessageStore local ops ${ - getMessageForException(e) ?? '{no exception message}' - }`; - onStateDifference?.(message); - } -} - const newThread = (): ThreadMessageInfo => ({ messageIDs: [], startReached: false, @@ -778,7 +751,6 @@ messageStore: MessageStore, action: BaseAction, newThreadInfos: RawThreadInfos, - onStateDifference?: (message: string) => mixed, ): ReduceMessageStoreResult { if ( action.type === legacyLogInActionTypes.success || @@ -1687,16 +1659,6 @@ const actionPayloadMessageStoreLocalMessageInfos = action.payload.messageStoreLocalMessageInfos ?? {}; - assertMessageStoreLocalMessageInfosAreEqual( - { - ...messageStore, - local: actionPayloadMessageStoreLocalMessageInfos, - }, - messageStore, - action.type, - onStateDifference, - ); - const newThreads: { [threadID: string]: ThreadMessageInfo, } = { ...messageStore.threads }; @@ -1711,7 +1673,11 @@ if (!payloadMessages) { return { messageStoreOperations: [], - messageStore: { ...messageStore, threads: newThreads }, + messageStore: { + ...messageStore, + threads: newThreads, + local: actionPayloadMessageStoreLocalMessageInfos, + }, }; }