Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33452240
D7397.1769025328.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7397.1769025328.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
Wed, Jan 21, 7:55 PM (8 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5971191
Default Alt Text
D7397.1769025328.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