Page MenuHomePhabricator

D7420.diff
No OneTemporary

D7420.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
@@ -1301,9 +1301,9 @@
const now = Date.now();
const messageIDsToPrune = [];
- const newThreads = { ...messageStore.threads };
+ const updatedThreads = {};
for (const threadID of action.payload.threadIDs) {
- let thread = newThreads[threadID];
+ let thread = messageStore.threads[threadID];
if (!thread) {
continue;
}
@@ -1322,7 +1322,7 @@
messageIDsToPrune.push(id);
}
- newThreads[threadID] = thread;
+ updatedThreads[threadID] = thread;
}
const messageStoreOperations = [
@@ -1330,20 +1330,38 @@
type: 'remove',
payload: { ids: messageIDsToPrune },
},
+ {
+ type: 'replace_threads',
+ payload: {
+ threads: updatedThreads,
+ },
+ },
];
+
const processedMessageStore = processMessageStoreOperations(
messageStore,
messageStoreOperations,
);
+ const newMessageStore = {
+ messages: processedMessageStore.messages,
+ threads: {
+ ...messageStore.threads,
+ ...updatedThreads,
+ },
+ local: _omit(messageIDsToPrune)(messageStore.local),
+ currentAsOf: messageStore.currentAsOf,
+ };
+
+ assertMessageStoreThreadsAreEqual(
+ processedMessageStore,
+ newMessageStore,
+ action.type,
+ );
+
return {
messageStoreOperations,
- messageStore: {
- messages: processedMessageStore.messages,
- threads: newThreads,
- local: _omit(messageIDsToPrune)(messageStore.local),
- currentAsOf: messageStore.currentAsOf,
- },
+ messageStore: newMessageStore,
};
} else if (action.type === updateMultimediaMessageMediaActionType) {
const { messageID: id, currentMediaID, mediaUpdate } = action.payload;

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 7:30 PM (18 h, 24 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682584
Default Alt Text
D7420.diff (1 KB)

Event Timeline