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 @@ -1874,7 +1874,8 @@ const sendingComposableDMMessageToPeers = composableMessageID && outboundP2PMessages && - outboundP2PMessages.length > 0; + outboundP2PMessages.length > 0 && + action.dispatchSource !== 'tab-sync'; // For composable DM messages, we rely on dedicated actions // (`sendTextMessageActionTypes` or `sendMultimediaMessageActionTypes`) diff --git a/lib/shared/dm-ops/process-dm-ops.js b/lib/shared/dm-ops/process-dm-ops.js --- a/lib/shared/dm-ops/process-dm-ops.js +++ b/lib/shared/dm-ops/process-dm-ops.js @@ -154,7 +154,11 @@ messagesNotifyTypes: {}, }; dispatchWithMetadata( - { type: processDMOpsActionType, payload }, + { + type: processDMOpsActionType, + payload, + dispatchSource: 'tunnelbroker', + }, dispatchMetadata, ); @@ -289,7 +293,11 @@ messagesNotifyTypes, }; dispatchWithMetadata( - { type: processDMOpsActionType, payload }, + { + type: processDMOpsActionType, + payload, + dispatchSource: 'tunnelbroker', + }, dispatchMetadata, ); }, @@ -404,7 +412,11 @@ messagesNotifyTypes, }; dispatchWithMetadata( - { type: processDMOpsActionType, payload }, + { + type: processDMOpsActionType, + payload, + dispatchSource: 'tunnelbroker', + }, { dmOpID }, ); diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -1563,6 +1563,7 @@ | { +type: 'PROCESS_DM_OPS', +payload: ProcessDMOpsPayload, + +dispatchSource?: DispatchSource, } | { +type: 'INVALIDATE_TUNNELBROKER_DEVICE_TOKEN', diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -547,12 +547,6 @@ } // The operations were already dispatched from the main tab - - // For now the `dispatchSource` field is not included in any of the - // redux actions and this causes flow to throw an error. - // As soon as one of the actions is updated, this fix (and the corresponding - // one in tab-synchronization.js) can be removed. - // $FlowFixMe if (action.dispatchSource === 'tab-sync') { return state; } diff --git a/web/redux/tab-synchronization.js b/web/redux/tab-synchronization.js --- a/web/redux/tab-synchronization.js +++ b/web/redux/tab-synchronization.js @@ -9,11 +9,6 @@ const tabSynchronizationMiddleware: Middleware = () => next => action => { const result = next(action); - // For now the `dispatchSource` field is not included in any of the - // redux actions and this causes flow to throw an error. - // As soon as one of the actions is updated, this fix (and the corresponding - // one in redux-setup.js) can be removed. - // $FlowFixMe if (action.dispatchSource === 'tunnelbroker') { WEB_REDUX_CHANNEL.postMessage(action); }