Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3353796
D11455.id38798.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11455.id38798.diff
View Options
diff --git a/lib/shared/messages/update-relationship-message-spec.js b/lib/shared/messages/update-relationship-message-spec.js
--- a/lib/shared/messages/update-relationship-message-spec.js
+++ b/lib/shared/messages/update-relationship-message-spec.js
@@ -88,15 +88,19 @@
rawMessageInfoFromClientDB(
clientDBMessageInfo: ClientDBMessageInfo,
- ): RawLegacyUpdateRelationshipMessageInfo {
+ ):
+ | RawLegacyUpdateRelationshipMessageInfo
+ | RawUpdateRelationshipMessageInfo {
invariant(
clientDBMessageInfo.content !== undefined &&
clientDBMessageInfo.content !== null,
'content must be defined for UpdateRelationship',
);
const content = JSON.parse(clientDBMessageInfo.content);
- const rawUpdateRelationshipMessageInfo: RawLegacyUpdateRelationshipMessageInfo =
- {
+
+ const messageType = parseInt(clientDBMessageInfo.type);
+ if (messageType === messageTypes.LEGACY_UPDATE_RELATIONSHIP) {
+ return {
type: messageTypes.LEGACY_UPDATE_RELATIONSHIP,
id: clientDBMessageInfo.id,
threadID: clientDBMessageInfo.thread,
@@ -105,7 +109,17 @@
targetID: content.targetID,
operation: content.operation,
};
- return rawUpdateRelationshipMessageInfo;
+ } else {
+ return {
+ type: messageTypes.UPDATE_RELATIONSHIP,
+ id: clientDBMessageInfo.id,
+ threadID: clientDBMessageInfo.thread,
+ time: parseInt(clientDBMessageInfo.time),
+ creatorID: clientDBMessageInfo.user,
+ targetID: content.targetID,
+ operation: content.operation,
+ };
+ }
},
createMessageInfo(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 11:27 AM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575019
Default Alt Text
D11455.id38798.diff (1 KB)
Attached To
Mode
D11455: [lib] Update `rawMessageInfoFromClientDB` to support `RawUpdateRelationshipMessageInfo`
Attached
Detach File
Event Timeline
Log In to Comment