Properly retry story messages

This commit is contained in:
Josh Perez 2022-12-22 19:48:09 -05:00 committed by GitHub
parent 55a1c5f6c5
commit 1b3a631903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1383,6 +1383,23 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
this.set('sendStateByConversationId', newSendStateByConversationId);
if (isStory(this.attributes)) {
await conversationJobQueue.add(
{
type: conversationQueueJobEnum.enum.Story,
conversationId: conversation.id,
messageIds: [this.id],
// using the group timestamp, which will differ from the 1:1 timestamp
timestamp: this.attributes.timestamp,
},
async jobToInsert => {
await window.Signal.Data.saveMessage(this.attributes, {
jobToInsert,
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
});
}
);
} else {
await conversationJobQueue.add(
{
type: conversationQueueJobEnum.enum.NormalMessage,
@ -1398,6 +1415,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
}
);
}
}
isReplayableError(e: Error): boolean {
return (