From e94eaf07a9b28a3d165e38a90c602f3402153807 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 20 Jul 2021 17:29:44 -0700 Subject: [PATCH] Message.sendSyncMessage: properly handle falsey id field --- ts/models/messages.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 05757518c..5d9bbbebf 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -1851,7 +1851,9 @@ export class MessageModel extends window.Backbone.Model { isUpdate, options: sendOptions, }), - { messageIds: [this.id], sendType: 'sentSync' } + // Note: in some situations, for doNotSave messages, the message has no + // id, so we provide an empty array here. + { messageIds: this.id ? [this.id] : [], sendType: 'sentSync' } ).then(async result => { let newSendStateByConversationId: undefined | SendStateByConversationId; const sendStateByConversationId =