From fa25d5aaf8ade467dbe677c067b196db255f0b11 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:13:30 -0700 Subject: [PATCH] Fix link-and-sync in Alpha --- ts/textsecure/AccountManager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/textsecure/AccountManager.ts b/ts/textsecure/AccountManager.ts index d2cdc6c952c1..80167912dc42 100644 --- a/ts/textsecure/AccountManager.ts +++ b/ts/textsecure/AccountManager.ts @@ -59,6 +59,7 @@ import * as log from '../logging/log'; import type { StorageAccessType } from '../types/Storage'; import { getRelativePath, createName } from '../util/attachmentPath'; import { isBackupEnabled } from '../util/isBackupEnabled'; +import { isLinkAndSyncEnabled } from '../util/isLinkAndSyncEnabled'; import { getMessageQueueTime } from '../util/getMessageQueueTime'; type StorageKeyByServiceIdKind = { @@ -1097,10 +1098,14 @@ export default class AccountManager extends EventTarget { throw missingCaseError(options); } + const shouldDownloadBackup = + isBackupEnabled() || + (isLinkAndSyncEnabled(window.getVersion()) && options.ephemeralBackupKey); + // Set backup download path before storing credentials to ensure that // storage service and message receiver are not operating // until the backup is downloaded and imported. - if (isBackupEnabled() && cleanStart) { + if (shouldDownloadBackup && cleanStart) { if (options.type === AccountType.Linked && options.ephemeralBackupKey) { await storage.put('backupEphemeralKey', options.ephemeralBackupKey); }