Page MenuHomePhorge

D13153.1768512900.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D13153.1768512900.diff

diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -1660,6 +1660,21 @@
const actionPayloadMessageStoreLocalMessageInfos =
action.payload.messageStoreLocalMessageInfos ?? {};
+ for (const localMessageID in actionPayloadMessageStoreLocalMessageInfos) {
+ if (
+ actionPayloadMessageStoreLocalMessageInfos[localMessageID]
+ .outboundP2PMessages &&
+ actionPayloadMessageStoreLocalMessageInfos[localMessageID]
+ .outboundP2PMessages.length > 0
+ ) {
+ // If there are `outboundP2PMessages` it means the message failed,
+ // but setting `sendFailed` could not be done, e.g. when the app was
+ // killed in the process of sending messages.
+ actionPayloadMessageStoreLocalMessageInfos[localMessageID].sendFailed =
+ true;
+ }
+ }
+
const newThreads: {
[threadID: string]: ThreadMessageInfo,
} = { ...messageStore.threads };
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
@@ -439,8 +439,12 @@
// Tracks client-local information about a message that hasn't been assigned an
// ID by the server yet. As soon as the client gets an ack from the server for
// this message, it will clear the LocalMessageInfo.
+// For DMs, it keeps track of P2P Messages that are not yet sent.
+// As soon as messages are queued on Tunnelbroker, it will
+// clear the LocalMessageInfo.
export type LocalMessageInfo = {
+sendFailed?: boolean,
+ +outboundP2PMessageIDs?: $ReadOnlyArray<string>,
};
const localMessageInfoValidator: TInterface<LocalMessageInfo> =
tShape<LocalMessageInfo>({

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 15, 9:35 PM (4 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5940186
Default Alt Text
D13153.1768512900.diff (1 KB)

Event Timeline