Page MenuHomePhabricator

D7397.diff
No OneTemporary

D7397.diff

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
@@ -100,8 +100,11 @@
processUpdatesActionType,
} from '../types/update-types.js';
import { setNewSessionActionType } from '../utils/action-utils.js';
+import { isDev } from '../utils/dev-utils.js';
import { translateClientDBMessageInfosToRawMessageInfos } from '../utils/message-ops-utils.js';
+import { assertObjectsAreEqual } from '../utils/objects.js';
+const PROCESSED_MSG_STORE_INVARIANTS_DISABLED = !isDev;
const _mapValuesWithKeys = _mapValues.convert({ cap: false });
// Input must already be ordered!
@@ -133,6 +136,23 @@
);
}
+// eslint-disable-next-line no-unused-vars
+function assertMessageStoreThreadsAreEqual(
+ processedMessageStore: MessageStore,
+ expectedMessageStore: MessageStore,
+ location: string,
+) {
+ if (PROCESSED_MSG_STORE_INVARIANTS_DISABLED) {
+ return;
+ }
+
+ assertObjectsAreEqual(
+ processedMessageStore.threads,
+ expectedMessageStore.threads,
+ `MessageStore.threads - ${location}`,
+ );
+}
+
const newThread = () => ({
messageIDs: [],
startReached: false,

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 6:05 PM (21 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2500057
Default Alt Text
D7397.diff (1 KB)

Event Timeline