Move to MessageCache.saveMessage, queue downloads piecemeal

This commit is contained in:
Scott Nonnenberg
2025-01-24 06:37:18 -10:00
committed by GitHub
parent 197660a966
commit ed30059bd5
32 changed files with 138 additions and 298 deletions

View File

@@ -10,7 +10,6 @@ import type { StoryMessageRecipientsType } from '../types/Stories';
import type { StoryDistributionIdString } from '../types/StoryDistributionId';
import type { ServiceIdString } from '../types/ServiceId';
import * as log from '../logging/log';
import { DataWriter } from '../sql/Client';
import { DAY } from './durations';
import { StoryRecipientUpdateEvent } from '../textsecure/messageReceiverEvents';
import {
@@ -24,7 +23,6 @@ import { getMessageById } from '../messages/getMessageById';
import { strictAssert } from './assert';
import { repeat, zipObject } from './iterables';
import { isOlderThan } from './timestamp';
import { postSaveUpdates } from './cleanup';
export async function deleteStoryForEveryone(
stories: ReadonlyArray<StoryDataType>,
@@ -192,10 +190,8 @@ export async function deleteStoryForEveryone(
await conversationJobQueue.add(jobData, async jobToInsert => {
log.info(`${logId}: Deleting message with job ${jobToInsert.id}`);
await DataWriter.saveMessage(message.attributes, {
await window.MessageCache.saveMessage(message.attributes, {
jobToInsert,
ourAci: window.textsecure.storage.user.getCheckedAci(),
postSaveUpdates,
});
});
} catch (error) {