Page MenuHomePhabricator

D13182.diff
No OneTemporary

D13182.diff

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
@@ -58,6 +58,7 @@
+recipients:
| { +type: 'all_peer_devices' | 'self_devices' }
| { +type: 'some_users', +userIDs: $ReadOnlyArray<string> },
+ +sendOnly?: boolean,
};
// The operation received from other peers, causes changes to
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
@@ -68,6 +68,8 @@
return;
}
+ const { op: dmOp } = dmOperationSpecification;
+
let outboundP2PMessages: ?$ReadOnlyArray<OutboundP2PMessage> = null;
if (
dmOperationSpecification.type === dmOperationSpecificationTypes.OUTBOUND
@@ -94,7 +96,41 @@
dispatchMetadata = dmOperationSpecification.metadata;
}
- const { op: dmOp } = dmOperationSpecification;
+ let messageIDWithoutAutoRetry: ?string = null;
+ if (
+ dmOperationSpecification.type ===
+ dmOperationSpecificationTypes.OUTBOUND &&
+ !dmOpSpecs[dmOp.type].supportsAutoRetry
+ ) {
+ messageIDWithoutAutoRetry = dmOp.messageID;
+ }
+
+ if (
+ dmOperationSpecification.type ===
+ dmOperationSpecificationTypes.OUTBOUND &&
+ dmOperationSpecification.sendOnly
+ ) {
+ const notificationsCreationData = await dmOpSpecs[
+ dmOp.type
+ ].notificationsCreationData?.(dmOp, utilities);
+
+ dispatchWithMetadata(
+ {
+ type: processDMOpsActionType,
+ payload: {
+ rawMessageInfos: [],
+ updateInfos: [],
+ outboundP2PMessages,
+ messageIDWithoutAutoRetry,
+ notificationsCreationData,
+ },
+ },
+ dispatchMetadata,
+ );
+
+ return;
+ }
+
const processingCheckResult = dmOpSpecs[dmOp.type].canBeProcessed(
dmOp,
viewerID,
@@ -194,15 +230,6 @@
});
}
- let messageIDWithoutAutoRetry: ?string = null;
- if (
- dmOperationSpecification.type ===
- dmOperationSpecificationTypes.OUTBOUND &&
- !dmOpSpecs[dmOperationSpecification.op.type].supportsAutoRetry
- ) {
- messageIDWithoutAutoRetry = dmOperationSpecification.op.messageID;
- }
-
dispatchWithMetadata(
{
type: processDMOpsActionType,

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 7:32 PM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577123
Default Alt Text
D13182.diff (2 KB)

Event Timeline