mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Drop invalid keyChange messages on export
This commit is contained in:
@@ -1900,12 +1900,21 @@ export class BackupExportStream extends Readable {
|
||||
const simpleUpdate = new Backups.SimpleChatUpdate();
|
||||
simpleUpdate.type = Backups.SimpleChatUpdate.Type.IDENTITY_UPDATE;
|
||||
|
||||
if (message.key_changed) {
|
||||
const conversation = window.ConversationController.get(
|
||||
message.conversationId
|
||||
);
|
||||
if (
|
||||
conversation &&
|
||||
isGroup(conversation.attributes) &&
|
||||
message.key_changed
|
||||
) {
|
||||
const target = window.ConversationController.get(message.key_changed);
|
||||
if (!target) {
|
||||
throw new Error(
|
||||
'toChatItemUpdate/keyCahnge: key_changed conversation not found!'
|
||||
log.warn(
|
||||
'toChatItemUpdate/keyChange: key_changed conversation not found!',
|
||||
message.key_changed
|
||||
);
|
||||
return { kind: NonBubbleResultKind.Drop };
|
||||
}
|
||||
// This will override authorId on the original chatItem
|
||||
patch.authorId = this.#getOrPushPrivateRecipient(target.attributes);
|
||||
|
||||
@@ -181,11 +181,9 @@ export async function markConversationRead(
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// This is expected for directionless messages which are inserted as Read but Unseen
|
||||
// (e.g. keyChange)
|
||||
if (!isAciString(senderAci)) {
|
||||
log.warn(
|
||||
`${logId}: message sourceServiceId timestamp is not aci` +
|
||||
`type=${messageSyncData.type}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user