Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3356592
D13182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13182.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13182: [lib] add option to mark `DMOperationSpecification` as `sendOnly`
Attached
Detach File
Event Timeline
Log In to Comment