mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-02 00:07:56 +01:00
Improvements to local import testing
This commit is contained in:
@@ -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}.`
|
||||
);
|
||||
|
||||
@@ -391,7 +391,7 @@ export class Provisioner {
|
||||
.toAppUrl({
|
||||
uuid,
|
||||
pubKey: Bytes.toBase64(cipher.getPublicKey().serialize()),
|
||||
capabilities: isLinkAndSyncEnabled() ? ['backup4', 'backup5'] : [],
|
||||
capabilities: isLinkAndSyncEnabled() ? ['backup5'] : [],
|
||||
})
|
||||
.toString();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user