Retry outbound "normal" messages for up to a day
This commit is contained in:
parent
62cf51c060
commit
a85dd1be36
30 changed files with 1414 additions and 603 deletions
|
@ -40,6 +40,7 @@ import {
|
|||
MessageModelCollectionType,
|
||||
} from '../model-types.d';
|
||||
import { StoredJob } from '../jobs/types';
|
||||
import { formatJobForInsert } from '../jobs/formatJobForInsert';
|
||||
|
||||
import {
|
||||
AttachmentDownloadJobType,
|
||||
|
@ -206,6 +207,7 @@ const dataInterface: ClientInterface = {
|
|||
|
||||
getMessageBySender,
|
||||
getMessageById,
|
||||
getMessagesById,
|
||||
getAllMessageIds,
|
||||
getMessagesBySentAt,
|
||||
getExpiredMessages,
|
||||
|
@ -1070,9 +1072,12 @@ async function getMessageCount(conversationId?: string) {
|
|||
|
||||
async function saveMessage(
|
||||
data: MessageType,
|
||||
options?: { forceSave?: boolean }
|
||||
options: { jobToInsert?: Readonly<StoredJob>; forceSave?: boolean } = {}
|
||||
) {
|
||||
const id = await channels.saveMessage(_cleanMessageData(data), options);
|
||||
const id = await channels.saveMessage(_cleanMessageData(data), {
|
||||
...options,
|
||||
jobToInsert: options.jobToInsert && formatJobForInsert(options.jobToInsert),
|
||||
});
|
||||
|
||||
window.Whisper.ExpiringMessagesListener.update();
|
||||
window.Whisper.TapToViewMessagesListener.update();
|
||||
|
@ -1124,6 +1129,13 @@ async function getMessageById(
|
|||
return new Message(message);
|
||||
}
|
||||
|
||||
async function getMessagesById(messageIds: Array<string>) {
|
||||
if (!messageIds.length) {
|
||||
return [];
|
||||
}
|
||||
return channels.getMessagesById(messageIds);
|
||||
}
|
||||
|
||||
// For testing only
|
||||
async function _getAllMessages({
|
||||
MessageCollection,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue