Use minimal replacement class for MessageModel

This commit is contained in:
Scott Nonnenberg 2025-01-10 08:18:32 +10:00 committed by GitHub
parent 6b00cf756e
commit f846678b90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
95 changed files with 3919 additions and 4457 deletions

View file

@ -12,6 +12,7 @@ import type { MessageAttributesType } from '../model-types.d';
import type { AciString } from '../types/ServiceId';
import * as Errors from '../types/errors';
import { DataReader, DataWriter } from '../sql/Client';
import { postSaveUpdates } from '../util/cleanup';
const MAX_CONCURRENCY = 5;
@ -57,7 +58,7 @@ export async function _migrateMessageData({
) => Promise<Array<MessageAttributesType>>;
saveMessagesIndividually: (
data: ReadonlyArray<MessageAttributesType>,
options: { ourAci: AciString }
options: { ourAci: AciString; postSaveUpdates: () => Promise<void> }
) => Promise<{ failedIndices: Array<number> }>;
incrementMessagesMigrationAttempts: (
messageIds: ReadonlyArray<string>
@ -122,6 +123,7 @@ export async function _migrateMessageData({
upgradedMessages,
{
ourAci,
postSaveUpdates,
}
);