Skip to content

Commit

Permalink
Message.sendSyncMessage: properly handle falsey id field
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jul 21, 2021
1 parent 6893bbe commit e94eaf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ts/models/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,9 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
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 =
Expand Down

0 comments on commit e94eaf0

Please sign in to comment.