Fix processing of cached envelopes
This commit is contained in:
parent
96718464ef
commit
176baecf72
3 changed files with 10 additions and 6 deletions
|
@ -4825,6 +4825,7 @@ function getUnprocessedByIdsAndIncrementAttempts(
|
||||||
...row,
|
...row,
|
||||||
urgent: isNumber(row.urgent) ? Boolean(row.urgent) : true,
|
urgent: isNumber(row.urgent) ? Boolean(row.urgent) : true,
|
||||||
story: Boolean(row.story),
|
story: Boolean(row.story),
|
||||||
|
isEncrypted: Boolean(row.isEncrypted),
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,6 +403,9 @@ export default class MessageReceiver
|
||||||
|
|
||||||
const ourAci = this.#storage.user.getCheckedAci();
|
const ourAci = this.#storage.user.getCheckedAci();
|
||||||
|
|
||||||
|
const { content } = decoded;
|
||||||
|
strictAssert(content != null, 'Content is required for envelopes');
|
||||||
|
|
||||||
const envelope: ProcessedEnvelope = {
|
const envelope: ProcessedEnvelope = {
|
||||||
// Make non-private envelope IDs dashless so they don't get redacted
|
// Make non-private envelope IDs dashless so they don't get redacted
|
||||||
// from logs
|
// from logs
|
||||||
|
@ -439,7 +442,7 @@ export default class MessageReceiver
|
||||||
)
|
)
|
||||||
: undefined,
|
: undefined,
|
||||||
timestamp: decoded.timestamp?.toNumber() ?? 0,
|
timestamp: decoded.timestamp?.toNumber() ?? 0,
|
||||||
content: dropNull(decoded.content),
|
content,
|
||||||
serverGuid: decoded.serverGuid ?? getGuid(),
|
serverGuid: decoded.serverGuid ?? getGuid(),
|
||||||
serverTimestamp,
|
serverTimestamp,
|
||||||
urgent: isBoolean(decoded.urgent) ? decoded.urgent : true,
|
urgent: isBoolean(decoded.urgent) ? decoded.urgent : true,
|
||||||
|
@ -895,7 +898,7 @@ export default class MessageReceiver
|
||||||
)
|
)
|
||||||
: undefined,
|
: undefined,
|
||||||
timestamp: item.timestamp,
|
timestamp: item.timestamp,
|
||||||
content: item.isEncrypted ? item.content : undefined,
|
content: item.content,
|
||||||
serverGuid: item.serverGuid,
|
serverGuid: item.serverGuid,
|
||||||
serverTimestamp: item.serverTimestamp,
|
serverTimestamp: item.serverTimestamp,
|
||||||
urgent: isBoolean(item.urgent) ? item.urgent : true,
|
urgent: isBoolean(item.urgent) ? item.urgent : true,
|
||||||
|
@ -1104,7 +1107,9 @@ export default class MessageReceiver
|
||||||
updatedPni: envelope.updatedPni,
|
updatedPni: envelope.updatedPni,
|
||||||
serverGuid: envelope.serverGuid,
|
serverGuid: envelope.serverGuid,
|
||||||
serverTimestamp: envelope.serverTimestamp,
|
serverTimestamp: envelope.serverTimestamp,
|
||||||
decrypted: plaintext,
|
timestamp: envelope.timestamp,
|
||||||
|
isEncrypted: false,
|
||||||
|
content: plaintext,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1171,8 +1176,6 @@ export default class MessageReceiver
|
||||||
envelope: ProcessedEnvelope,
|
envelope: ProcessedEnvelope,
|
||||||
request: IncomingWebSocketRequest
|
request: IncomingWebSocketRequest
|
||||||
): void {
|
): void {
|
||||||
strictAssert(envelope.content, 'Content is required for envelopes');
|
|
||||||
|
|
||||||
const { id } = envelope;
|
const { id } = envelope;
|
||||||
const data: UnprocessedType = {
|
const data: UnprocessedType = {
|
||||||
id,
|
id,
|
||||||
|
|
2
ts/textsecure/Types.d.ts
vendored
2
ts/textsecure/Types.d.ts
vendored
|
@ -92,7 +92,7 @@ export type ProcessedEnvelope = Readonly<{
|
||||||
destinationServiceId: ServiceIdString;
|
destinationServiceId: ServiceIdString;
|
||||||
updatedPni: PniString | undefined;
|
updatedPni: PniString | undefined;
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
content: Uint8Array | undefined;
|
content: Uint8Array;
|
||||||
serverGuid: string;
|
serverGuid: string;
|
||||||
serverTimestamp: number;
|
serverTimestamp: number;
|
||||||
groupId: string | undefined;
|
groupId: string | undefined;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue