Page MenuHomePhabricator

D13433.id44508.diff
No OneTemporary

D13433.id44508.diff

diff --git a/lib/shared/dm-ops/update-relationship-spec.js b/lib/shared/dm-ops/update-relationship-spec.js
--- a/lib/shared/dm-ops/update-relationship-spec.js
+++ b/lib/shared/dm-ops/update-relationship-spec.js
@@ -12,14 +12,15 @@
dmOperation: DMUpdateRelationshipOperation,
utilities: ProcessDMOperationUtilities,
) {
- const { threadID, creatorID, time, operation, messageID } = dmOperation;
- const { viewerID, findUserIdentities } = utilities;
+ const { threadID, creatorID, time, operation, messageID, targetUserID } =
+ dmOperation;
+ const { findUserIdentities } = utilities;
if (operation !== 'farcaster_mutual') {
const messageData = {
type: messageTypes.UPDATE_RELATIONSHIP,
threadID,
creatorID,
- targetID: viewerID,
+ targetID: targetUserID,
time,
operation,
};
@@ -31,12 +32,12 @@
}
const { identities: userIdentities } = await findUserIdentities([
creatorID,
- viewerID,
+ targetUserID,
]);
const creatorFID = userIdentities[creatorID]?.farcasterID;
- const targetFID = userIdentities[viewerID]?.farcasterID;
+ const targetFID = userIdentities[targetUserID]?.farcasterID;
if (!creatorFID || !targetFID) {
- const errorMap = { creatorID: creatorFID, viewerID: targetFID };
+ const errorMap = { [creatorID]: creatorFID, [targetUserID]: targetFID };
throw new Error(
'could not fetch FID for either creator or target: ' +
JSON.stringify(errorMap),
@@ -47,7 +48,7 @@
threadID,
creatorID,
creatorFID,
- targetID: viewerID,
+ targetID: targetUserID,
targetFID,
time,
operation,
diff --git a/lib/types/dm-ops.js b/lib/types/dm-ops.js
--- a/lib/types/dm-ops.js
+++ b/lib/types/dm-ops.js
@@ -454,6 +454,7 @@
+creatorID: string,
+time: number,
+operation: RelationshipOperation,
+ +targetUserID: string,
+messageID: string,
};
export const dmUpdateRelationshipOperationValidator: TInterface<DMUpdateRelationshipOperation> =
@@ -467,6 +468,7 @@
'request_accepted',
'farcaster_mutual',
]),
+ targetUserID: tUserID,
messageID: t.String,
});

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 3:14 PM (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535131
Default Alt Text
D13433.id44508.diff (2 KB)

Event Timeline