Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3371367
D12686.id42779.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D12686.id42779.diff
View Options
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
@@ -22,40 +22,13 @@
fullStateSyncActionType,
stateSyncPayloadTypes,
} 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,
- `ThreadHashes - ${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,
},
@@ -112,14 +85,22 @@
integrityStoreOperations: [],
};
} else if (action.type === setClientDBStoreActionType) {
- assertIntegrityStoresAreEqual(
- action.payload.threadHashes ?? {},
- state.threadHashes,
- action.type,
- onStateDifference,
- );
+ const newThreadHashes = action.payload.threadHashes;
+
+ if (!newThreadHashes) {
+ return {
+ integrityStore: state,
+ integrityStoreOperations: [],
+ };
+ }
+
+ const newIntegrityStore: IntegrityStore = {
+ ...state,
+ threadHashes: newThreadHashes,
+ };
+
return {
- integrityStore: state,
+ integrityStore: newIntegrityStore,
integrityStoreOperations: [],
};
}
diff --git a/lib/reducers/integrity-reducer.test.js b/lib/reducers/integrity-reducer.test.js
--- a/lib/reducers/integrity-reducer.test.js
+++ b/lib/reducers/integrity-reducer.test.js
@@ -96,7 +96,6 @@
reduceIntegrityStore(
oldIntegrityStore,
updateThreadHashesAction,
- () => null,
threadInfos,
[],
).integrityStore,
@@ -134,7 +133,6 @@
reduceIntegrityStore(
oldIntegrityStore,
updateThreadHashesAction,
- () => null,
threadInfos,
threadStoreOperations,
).integrityStore,
@@ -178,7 +176,6 @@
reduceIntegrityStore(
oldIntegrityStore,
updateThreadHashesAction,
- () => null,
threadInfos,
threadStoreOperations,
).integrityStore,
@@ -216,7 +213,6 @@
reduceIntegrityStore(
oldIntegrityStore,
updateThreadHashesAction,
- () => null,
threadInfos,
threadStoreOperations,
).integrityStore,
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
@@ -175,7 +175,6 @@
const { integrityStore, integrityStoreOperations } = reduceIntegrityStore(
state.integrityStore,
action,
- onStateDifferenceForStaff,
threadInfos,
threadStoreOperations,
);
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
@@ -22,6 +22,7 @@
'auxUserStore',
'commServicesAccessToken',
'inviteLinksStore',
+ 'integrityStore',
];
function handleReduxMigrationFailure(oldState: AppState): AppState {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 4:41 AM (16 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2588228
Default Alt Text
D12686.id42779.diff (3 KB)
Attached To
Mode
D12686: [lib] remove integrity store assertion and use sqlite
Attached
Detach File
Event Timeline
Log In to Comment