Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3507354
D7418.id25107.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.id25107.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
@@ -1245,25 +1245,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, 8:28 PM (19 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2688981
Default Alt Text
D7418.id25107.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