Improvements to local import testing

This commit is contained in:
trevor-signal
2026-03-10 12:01:01 -04:00
committed by GitHub
parent a03229349e
commit 3bd11cf215
3 changed files with 22 additions and 1 deletions

View File

@@ -537,11 +537,26 @@ export class BackupsService {
const { success, error } = result;
if (success) {
this.#localBackupSnapshotDir = snapshotDir;
if (!isTestOrMockEnvironment()) {
// Regenerate QR code without link & sync option
window.reduxActions.installer.startInstaller();
// eslint-disable-next-line no-alert
window.alert(
'Staged backup successfully. Please link to perform import.'
);
}
log.info(
`stageLocalBackupForImport: Staged ${snapshotDir} for import. Please link to perform import.`
);
} else {
this.#localBackupSnapshotDir = undefined;
// eslint-disable-next-line no-alert
window.alert(
'Invalid backup snapshot directory; make sure you choose a snapshot directory (e.g. `signal-backup-2026-01-01-12-00-00`)'
);
log.info(
`stageLocalBackupForImport: Invalid snapshot ${snapshotDir}. Error: ${error}.`
);

View File

@@ -391,7 +391,7 @@ export class Provisioner {
.toAppUrl({
uuid,
pubKey: Bytes.toBase64(cipher.getPublicKey().serialize()),
capabilities: isLinkAndSyncEnabled() ? ['backup4', 'backup5'] : [],
capabilities: isLinkAndSyncEnabled() ? ['backup5'] : [],
})
.toString();

View File

@@ -1,6 +1,7 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { backupsService } from '../services/backups/index.preload.js';
import { everDone as wasRegistrationEverDone } from './registration.preload.js';
export function isLinkAndSyncEnabled(): boolean {
@@ -9,5 +10,10 @@ export function isLinkAndSyncEnabled(): boolean {
return false;
}
// For local backup import testing, prevent link & sync
if (backupsService.isLocalBackupStaged()) {
return false;
}
return true;
}