diff --git a/lib/reducers/integrity-reducer.js b/lib/reducers/integrity-reducer.js --- a/lib/reducers/integrity-reducer.js +++ b/lib/reducers/integrity-reducer.js @@ -18,40 +18,13 @@ import type { RawThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseAction } from '../types/redux-types.js'; import { fullStateSyncActionType } from '../types/socket-types.js'; -import { getMessageForException } from '../utils/errors.js'; -import { assertObjectsAreEqual, hash } from '../utils/objects.js'; +import { hash } from '../utils/objects.js'; const { processStoreOperations: processStoreOps } = integrityStoreOpsHandlers; -function assertIntegrityStoresAreEqual( - processedIntegrityStore: ThreadHashes, - expectedIntegrityStore: ThreadHashes, - location: string, - onStateDifference?: (message: string) => mixed, -) { - try { - assertObjectsAreEqual( - processedIntegrityStore, - expectedIntegrityStore, - `IntegrityInfos - ${location}`, - ); - } catch (e) { - console.log( - 'Error processing IntegrityStore ops', - processedIntegrityStore, - expectedIntegrityStore, - ); - const message = `Error processing IntegrityStore ops ${ - getMessageForException(e) ?? '{no exception message}' - }`; - onStateDifference?.(message); - } -} - function reduceIntegrityStore( state: IntegrityStore, action: BaseAction, - onStateDifference?: (message: string) => mixed, threadInfos: { +[string]: RawThreadInfo, }, @@ -103,19 +76,7 @@ }, integrityStoreOperations: [], }; - } else if (action.type === setClientDBStoreActionType) { - assertIntegrityStoresAreEqual( - action.payload.threadHashes ?? {}, - state.threadHashes, - action.type, - onStateDifference, - ); - return { - integrityStore: state, - integrityStoreOperations: [], - }; } - let newState = state; const integrityOperations: IntegrityStoreOperation[] = []; if (action.type === updateIntegrityStoreActionType) { 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 @@ -164,7 +164,6 @@ const { integrityStore, integrityStoreOperations } = reduceIntegrityStore( state.integrityStore, action, - onStateDifferenceForStaff, threadInfos, threadStoreOperations, ); diff --git a/lib/reducers/message-reducer.test.js b/lib/reducers/message-reducer.test.js --- a/lib/reducers/message-reducer.test.js +++ b/lib/reducers/message-reducer.test.js @@ -293,7 +293,6 @@ users: {}, keyserverInfos: {}, communityInfos: {}, - threadHashes: {}, }, }, { diff --git a/lib/types/store-ops-types.js b/lib/types/store-ops-types.js --- a/lib/types/store-ops-types.js +++ b/lib/types/store-ops-types.js @@ -6,7 +6,6 @@ ClientDBDraftStoreOperation, ClientDBDraftInfo, } from './draft-types.js'; -import type { ThreadHashes } from './integrity-types.js'; import type { KeyserverInfos } from './keyserver-types.js'; import type { ClientDBMessageInfo, @@ -91,5 +90,4 @@ +users: ?UserInfos, +keyserverInfos: ?KeyserverInfos, +communityInfos: ?CommunityInfos, - +threadHashes: ?ThreadHashes, }; diff --git a/native/data/sqlite-data-handler.js b/native/data/sqlite-data-handler.js --- a/native/data/sqlite-data-handler.js +++ b/native/data/sqlite-data-handler.js @@ -8,7 +8,6 @@ import type { CallKeyserverEndpoint } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { useKeyserverRecoveryLogIn } from 'lib/keyserver-conn/recovery-utils.js'; import { communityStoreOpsHandlers } from 'lib/ops/community-store-ops.js'; -import { integrityStoreOpsHandlers } from 'lib/ops/integrity-store-ops.js'; import { keyserverStoreOpsHandlers } from 'lib/ops/keyserver-store-ops.js'; import { reportStoreOpsHandlers } from 'lib/ops/report-store-ops.js'; import { threadStoreOpsHandlers } from 'lib/ops/thread-store-ops.js'; @@ -207,7 +206,6 @@ users, keyservers, communities, - integrityThreadHashes, } = await commCoreModule.getClientDBStore(); const threadInfosFromDB = threadStoreOpsHandlers.translateClientDBData(threads); @@ -218,10 +216,6 @@ keyserverStoreOpsHandlers.translateClientDBData(keyservers); const communityInfosFromDB = communityStoreOpsHandlers.translateClientDBData(communities); - const threadHashesFromDB = - integrityStoreOpsHandlers.translateClientDBData( - integrityThreadHashes, - ); dispatch({ type: setClientDBStoreActionType, @@ -235,7 +229,6 @@ users: usersFromDB, keyserverInfos: keyserverInfosFromDB, communities: communityInfosFromDB, - threadHashes: threadHashesFromDB, }, }); } catch (setStoreException) { diff --git a/web/shared-worker/utils/store.js b/web/shared-worker/utils/store.js --- a/web/shared-worker/utils/store.js +++ b/web/shared-worker/utils/store.js @@ -27,7 +27,6 @@ users: null, keyserverInfos: defaultWebState.keyserverStore.keyserverInfos, communityInfos: null, - threadHashes: null, }; const data = await sharedWorker.schedule({ type: workerRequestMessageTypes.GET_CLIENT_STORE, @@ -70,14 +69,6 @@ ), }; } - if (data?.store?.integrityThreadHashes) { - result = { - ...result, - threadHashes: integrityStoreOpsHandlers.translateClientDBData( - data.store.integrityThreadHashes, - ), - }; - } return result; }