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,38 @@ const newMessageIDs = messageStore.threads[threadID].messageIDs.filter( id => id !== localID, ); + const newThread = { + ...messageStore.threads[threadID], + messageIDs: newMessageIDs, + }; + + messageStoreOperations.push({ + type: 'replace_thread', + payload: { threads: { [threadID]: newThread } }, + }); const processedMessageStore = processMessageStoreOperations( messageStore, messageStoreOperations, ); + const newMessageStore = { + ...processedMessageStore, + threads: { + ...messageStore.threads, + [threadID]: newThread, + }, + }; + + assertMessageStoreThreadsAreEqual( + processedMessageStore, + newMessageStore, + `${action.type} | reaction failure`, + ); + return { messageStoreOperations, - messageStore: { - ...processedMessageStore, - threads: { - ...messageStore.threads, - [threadID]: { - ...messageStore.threads[threadID], - messageIDs: newMessageIDs, - }, - }, - }, + messageStore: newMessageStore, }; } else if ( action.type === sendTextMessageActionTypes.success ||