Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3264808
D7410.id25368.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
D7410.id25368.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
@@ -179,10 +179,6 @@
payload: { id: messageID(messageInfo), messageInfo },
}),
);
- const messageStoreOperations = [
- { type: 'remove_all' },
- ...messageStoreReplaceOperations,
- ];
const threadsToMessageIDs =
mapThreadsToMessageIDsFromOrderedMessageInfos(orderedMessageInfos);
@@ -205,6 +201,19 @@
}
threads[threadID] = newThread();
}
+
+ const messageStoreOperations = [
+ { type: 'remove_all' },
+ {
+ type: 'remove_all_threads',
+ },
+ {
+ type: 'replace_threads',
+ payload: { threads },
+ },
+ ...messageStoreReplaceOperations,
+ ];
+
return {
messageStoreOperations,
messageStore: { messages, threads, local: {}, currentAsOf },
@@ -806,6 +815,12 @@
messageStoreOperations,
);
+ assertMessageStoreThreadsAreEqual(
+ processedMessageStore,
+ freshStore,
+ `${action.type} | fresh store`,
+ );
+
return {
messageStoreOperations,
messageStore: { ...freshStore, messages: processedMessageStore.messages },
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 12:49 AM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2506208
Default Alt Text
D7410.id25368.diff (1 KB)
Attached To
Mode
D7410: [lib] generate message store ops for threads while creating fresh store
Attached
Detach File
Event Timeline
Log In to Comment