Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3253569
D7412.id25104.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
D7412.id25104.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
@@ -1127,24 +1127,40 @@
const newMessageIDs = messageStore.threads[threadID].messageIDs.filter(
id => id !== localID,
);
+ const updatedThreads = {
+ [threadID]: {
+ ...messageStore.threads[threadID],
+ messageIDs: newMessageIDs,
+ },
+ };
+
+ messageStoreOperations.push({
+ type: 'replace_threads',
+ payload: { threads: updatedThreads },
+ });
const processedMessageStore = processMessageStoreOperations(
messageStore,
messageStoreOperations,
);
+ const newMessageStore = {
+ ...processedMessageStore,
+ threads: {
+ ...messageStore.threads,
+ ...updatedThreads,
+ },
+ };
+
+ assertMessageStoreThreadsAreEqual(
+ processedMessageStore,
+ newMessageStore,
+ action.type,
+ );
+
return {
messageStoreOperations,
- messageStore: {
- ...processedMessageStore,
- threads: {
- ...messageStore.threads,
- [threadID]: {
- ...messageStore.threads[threadID],
- messageIDs: newMessageIDs,
- },
- },
- },
+ messageStore: newMessageStore,
};
} else if (
action.type === sendTextMessageActionTypes.success ||
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 7:13 PM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2501148
Default Alt Text
D7412.id25104.diff (1 KB)
Attached To
Mode
D7412: [lib] generate message store ops for threads on reaction failure
Attached
Detach File
Event Timeline
Log In to Comment