diff --git a/lib/shared/dm-ops/add-members-spec.js b/lib/shared/dm-ops/add-members-spec.js --- a/lib/shared/dm-ops/add-members-spec.js +++ b/lib/shared/dm-ops/add-members-spec.js @@ -121,6 +121,7 @@ }, }; }, + supportsAutoRetry: true, }); export { addMembersSpec, createAddNewMembersResults }; diff --git a/lib/shared/dm-ops/add-viewer-to-thread-members-spec.js b/lib/shared/dm-ops/add-viewer-to-thread-members-spec.js --- a/lib/shared/dm-ops/add-viewer-to-thread-members-spec.js +++ b/lib/shared/dm-ops/add-viewer-to-thread-members-spec.js @@ -75,6 +75,7 @@ }, }; }, + supportsAutoRetry: true, }); export { addViewerToThreadMembersSpec, createAddViewerToThreadMembersResults }; diff --git a/lib/shared/dm-ops/change-thread-settings-and-add-viewer-spec.js b/lib/shared/dm-ops/change-thread-settings-and-add-viewer-spec.js --- a/lib/shared/dm-ops/change-thread-settings-and-add-viewer-spec.js +++ b/lib/shared/dm-ops/change-thread-settings-and-add-viewer-spec.js @@ -72,6 +72,7 @@ utilities, ); }, + supportsAutoRetry: true, }); export { changeThreadSettingsAndAddViewerSpec }; diff --git a/lib/shared/dm-ops/change-thread-settings-spec.js b/lib/shared/dm-ops/change-thread-settings-spec.js --- a/lib/shared/dm-ops/change-thread-settings-spec.js +++ b/lib/shared/dm-ops/change-thread-settings-spec.js @@ -176,6 +176,7 @@ }, }; }, + supportsAutoRetry: true, }); export { changeThreadSettingsSpec, processChangeSettingsOperation }; diff --git a/lib/shared/dm-ops/create-sidebar-spec.js b/lib/shared/dm-ops/create-sidebar-spec.js --- a/lib/shared/dm-ops/create-sidebar-spec.js +++ b/lib/shared/dm-ops/create-sidebar-spec.js @@ -107,6 +107,7 @@ canBeProcessed() { return { isProcessingPossible: true }; }, + supportsAutoRetry: true, }); export { createSidebarSpec }; diff --git a/lib/shared/dm-ops/create-thread-spec.js b/lib/shared/dm-ops/create-thread-spec.js --- a/lib/shared/dm-ops/create-thread-spec.js +++ b/lib/shared/dm-ops/create-thread-spec.js @@ -188,6 +188,7 @@ canBeProcessed() { return { isProcessingPossible: true }; }, + supportsAutoRetry: true, }); export { diff --git a/lib/shared/dm-ops/dm-op-spec.js b/lib/shared/dm-ops/dm-op-spec.js --- a/lib/shared/dm-ops/dm-op-spec.js +++ b/lib/shared/dm-ops/dm-op-spec.js @@ -28,4 +28,5 @@ | { +type: 'missing_thread', +threadID: string } | { +type: 'invalid' }, }, + +supportsAutoRetry: boolean, }; diff --git a/lib/shared/dm-ops/dm-op-utils.js b/lib/shared/dm-ops/dm-op-utils.js --- a/lib/shared/dm-ops/dm-op-utils.js +++ b/lib/shared/dm-ops/dm-op-utils.js @@ -2,6 +2,7 @@ import uuid from 'uuid'; +import { dmOpSpecs } from './dm-op-specs.js'; import type { DMOperation } from '../../types/dm-ops.js'; import type { InboundActionMetadata } from '../../types/redux-types.js'; import { @@ -21,7 +22,6 @@ +userID: string, +deviceID: string, }>, - supportsAutoRetry: boolean, ): $ReadOnlyArray { const opMessage: DMOperationP2PMessage = { type: userActionsP2PMessageTypes.DM_OPERATION, @@ -38,7 +38,7 @@ plaintext, ciphertext: '', status: outboundP2PMessageStatuses.persisted, - supportsAutoRetry, + supportsAutoRetry: dmOpSpecs[message.type].supportsAutoRetry, }; outboundP2PMessages.push(messageToPeer); } @@ -55,7 +55,6 @@ export type OutboundDMOperationSpecification = { +type: 'OutboundDMOperationSpecification', +op: DMOperation, - +supportsAutoRetry: boolean, +recipients: | { +type: 'all_peer_devices' | 'self_devices' } | { +type: 'some_users', +userIDs: $ReadOnlyArray }, @@ -101,11 +100,7 @@ const targetPeers = peerUserIDAndDeviceIDs.filter( peer => peer.deviceID !== thisDeviceID, ); - return generateMessagesToPeers( - operation.op, - targetPeers, - operation.supportsAutoRetry, - ); + return generateMessagesToPeers(operation.op, targetPeers); } export { createMessagesToPeersFromDMOp }; diff --git a/lib/shared/dm-ops/join-thread-spec.js b/lib/shared/dm-ops/join-thread-spec.js --- a/lib/shared/dm-ops/join-thread-spec.js +++ b/lib/shared/dm-ops/join-thread-spec.js @@ -123,6 +123,7 @@ }, }; }, + supportsAutoRetry: true, }); export { joinThreadSpec }; diff --git a/lib/shared/dm-ops/leave-thread-spec.js b/lib/shared/dm-ops/leave-thread-spec.js --- a/lib/shared/dm-ops/leave-thread-spec.js +++ b/lib/shared/dm-ops/leave-thread-spec.js @@ -81,6 +81,7 @@ }, }; }, + supportsAutoRetry: true, }); export { leaveThreadSpec }; diff --git a/lib/shared/dm-ops/remove-members-spec.js b/lib/shared/dm-ops/remove-members-spec.js --- a/lib/shared/dm-ops/remove-members-spec.js +++ b/lib/shared/dm-ops/remove-members-spec.js @@ -85,6 +85,7 @@ }, }; }, + supportsAutoRetry: true, }); export { removeMembersSpec }; diff --git a/lib/shared/dm-ops/send-edit-message-spec.js b/lib/shared/dm-ops/send-edit-message-spec.js --- a/lib/shared/dm-ops/send-edit-message-spec.js +++ b/lib/shared/dm-ops/send-edit-message-spec.js @@ -43,6 +43,7 @@ }, }; }, + supportsAutoRetry: true, }); export { sendEditMessageSpec }; diff --git a/lib/shared/dm-ops/send-reaction-message-spec.js b/lib/shared/dm-ops/send-reaction-message-spec.js --- a/lib/shared/dm-ops/send-reaction-message-spec.js +++ b/lib/shared/dm-ops/send-reaction-message-spec.js @@ -51,6 +51,7 @@ }, }; }, + supportsAutoRetry: true, }); export { sendReactionMessageSpec }; diff --git a/lib/shared/dm-ops/send-text-message-spec.js b/lib/shared/dm-ops/send-text-message-spec.js --- a/lib/shared/dm-ops/send-text-message-spec.js +++ b/lib/shared/dm-ops/send-text-message-spec.js @@ -42,6 +42,7 @@ }, }; }, + supportsAutoRetry: false, }); export { sendTextMessageSpec };