Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3252123
D7397.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7397.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7397: [lib] restore function for asserting store after performing ops
Attached
Detach File
Event Timeline
Log In to Comment