diff --git a/ts/services/backups/export.preload.ts b/ts/services/backups/export.preload.ts index 812b2f2e16..a486c9ff1b 100644 --- a/ts/services/backups/export.preload.ts +++ b/ts/services/backups/export.preload.ts @@ -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); diff --git a/ts/util/markConversationRead.preload.ts b/ts/util/markConversationRead.preload.ts index 303f28c006..609236151e 100644 --- a/ts/util/markConversationRead.preload.ts +++ b/ts/util/markConversationRead.preload.ts @@ -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; }