Remove window.Signal.Migrations

This commit is contained in:
Fedor Indutny
2025-10-10 13:37:38 -07:00
committed by GitHub
parent 17cb59b64c
commit 40c31e138b
62 changed files with 550 additions and 799 deletions

View File

@@ -7,6 +7,11 @@ import { createLogger } from '../logging/log.js';
import { SignalService as Proto } from '../protobuf/index.js';
import protobuf from '../protobuf/wrap.js';
import { DurationInSeconds } from '../util/durations/index.js';
import {
getAbsoluteAttachmentPath,
writeNewAttachmentData,
deleteAttachmentData,
} from '../util/migrations.js';
import type { ContactAvatarType } from '../types/Avatar.js';
import type { AttachmentType } from '../types/Attachment.js';
import type { AciString } from '../types/ServiceId.js';
@@ -61,9 +66,7 @@ export async function parseContactsV2(
{
idForLogging: 'parseContactsV2',
ciphertextPath: window.Signal.Migrations.getAbsoluteAttachmentPath(
attachment.path
),
ciphertextPath: getAbsoluteAttachmentPath(attachment.path),
keysBase64: attachment.localKey,
size: attachment.size,
type: 'local',
@@ -155,7 +158,7 @@ export class ParseContactsTransform extends Transform {
const local =
// eslint-disable-next-line no-await-in-loop
await window.Signal.Migrations.writeNewAttachmentData(avatarData);
await writeNewAttachmentData(avatarData);
const contentType = this.activeContact.avatar?.contentType;
const prepared = prepareContact(this.activeContact, {
@@ -170,7 +173,7 @@ export class ParseContactsTransform extends Transform {
this.contacts.push(prepared);
} else {
// eslint-disable-next-line no-await-in-loop
await window.Signal.Migrations.deleteAttachmentData(local.path);
await deleteAttachmentData(local.path);
}
this.activeContact = undefined;