Page MenuHomePhabricator

D6151.id20719.diff
No OneTemporary

D6151.id20719.diff

diff --git a/lib/actions/message-actions.js b/lib/actions/message-actions.js
--- a/lib/actions/message-actions.js
+++ b/lib/actions/message-actions.js
@@ -6,7 +6,6 @@
FetchMessageInfosPayload,
SendMessageResult,
SendReactionMessageRequest,
- SendReactionMessageResult,
SimpleMessagesPayload,
} from '../types/message-types';
import type { MediaMessageServerDBContent } from '../types/messages/media.js';
@@ -207,17 +206,34 @@
callServerEndpoint: CallServerEndpoint,
): ((
request: SendReactionMessageRequest,
-) => Promise<SendReactionMessageResult>) => async request => {
- const response = await callServerEndpoint('create_reaction_message', {
- threadID: request.threadID,
- localID: request.localID,
- targetMessageID: request.targetMessageID,
- reaction: request.reaction,
- action: request.action,
- });
+) => Promise<SendMessageResult>) => async request => {
+ let resultInfo;
+ const getResultInfo = (passedResultInfo: CallServerEndpointResultInfo) => {
+ resultInfo = passedResultInfo;
+ };
+
+ const response = await callServerEndpoint(
+ 'create_reaction_message',
+ {
+ threadID: request.threadID,
+ localID: request.localID,
+ targetMessageID: request.targetMessageID,
+ reaction: request.reaction,
+ action: request.action,
+ },
+ { getResultInfo },
+ );
+
+ const resultInterface = resultInfo?.interface;
+ invariant(
+ resultInterface,
+ 'getResultInfo not called before callServerEndpoint resolves',
+ );
+
return {
id: response.newMessageInfo.id,
- newMessageInfo: response.newMessageInfo,
+ time: response.newMessageInfo.time,
+ interface: resultInterface,
};
};
diff --git a/lib/types/message-types.js b/lib/types/message-types.js
--- a/lib/types/message-types.js
+++ b/lib/types/message-types.js
@@ -517,11 +517,6 @@
+interface: CallServerEndpointResultInfoInterface,
};
-export type SendReactionMessageResult = {
- +id: string,
- +newMessageInfo: RawMessageInfo,
-};
-
export type SendMessagePayload = {
+localID: string,
+serverID: string,
diff --git a/native/chat/reaction-message-utils.js b/native/chat/reaction-message-utils.js
--- a/native/chat/reaction-message-utils.js
+++ b/native/chat/reaction-message-utils.js
@@ -76,10 +76,11 @@
action,
});
return {
+ localID,
serverID: result.id,
threadID,
- time: result.newMessageInfo.time,
- newMessageInfos: [result.newMessageInfo],
+ time: result.time,
+ interface: result.interface,
};
} catch (e) {
Alert.alert(
diff --git a/web/chat/reaction-message-utils.js b/web/chat/reaction-message-utils.js
--- a/web/chat/reaction-message-utils.js
+++ b/web/chat/reaction-message-utils.js
@@ -54,10 +54,11 @@
action,
});
return {
+ localID,
serverID: result.id,
threadID,
- time: result.newMessageInfo.time,
- newMessageInfos: [result.newMessageInfo],
+ time: result.time,
+ interface: result.interface,
};
} catch (e) {
pushModal(

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 8:30 PM (20 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571459
Default Alt Text
D6151.id20719.diff (3 KB)

Event Timeline