Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3265853
D7410.id25103.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.id25103.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' },
+ ...messageStoreReplaceOperations,
+ {
+ type: 'remove_all_threads',
+ },
+ {
+ type: 'replace_threads',
+ payload: { threads },
+ },
+ ];
+
return {
messageStoreOperations,
messageStore: { messages, threads, local: {}, currentAsOf },
@@ -805,6 +814,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, 1:34 AM (22 h, 36 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2510033
Default Alt Text
D7410.id25103.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