Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3507191
D7418.id25352.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
D7418.id25352.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
@@ -1236,25 +1236,41 @@
(localInfo: LocalMessageInfo, key: string) => key !== payload.localID,
)(messageStore.local);
+ const updatedThreads = {
+ [threadID]: {
+ ...messageStore.threads[threadID],
+ messageIDs: newMessageIDs,
+ },
+ };
+ messageStoreOperations.push({
+ type: 'replace_threads',
+ payload: { threads: updatedThreads },
+ });
+
const processedMessageStore = processMessageStoreOperations(
messageStore,
messageStoreOperations,
);
+ const newMessageStore = {
+ ...messageStore,
+ messages: processedMessageStore.messages,
+ threads: {
+ ...messageStore.threads,
+ ...updatedThreads,
+ },
+ local,
+ };
+
+ assertMessageStoreThreadsAreEqual(
+ processedMessageStore,
+ newMessageStore,
+ action.type,
+ );
+
return {
messageStoreOperations,
- messageStore: {
- ...messageStore,
- messages: processedMessageStore.messages,
- threads: {
- ...messageStore.threads,
- [threadID]: {
- ...messageStore.threads[threadID],
- messageIDs: newMessageIDs,
- },
- },
- local,
- },
+ messageStore: newMessageStore,
};
} else if (action.type === saveMessagesActionType) {
const truncationStatuses = {};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 7:37 PM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2688874
Default Alt Text
D7418.id25352.diff (1 KB)
Attached To
Mode
D7418: [lib] generate message store ops for threads after sending message
Attached
Detach File
Event Timeline
Log In to Comment