Enable link & sync in production

This commit is contained in:
trevor-signal 2025-02-12 11:35:05 -05:00 committed by GitHub
parent 7fb898441b
commit 205c477082
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 14 deletions

View file

@ -195,10 +195,7 @@ function startInstaller(): ThunkAction<
strictAssert(server, 'Expected a server');
if (!provisioner) {
provisioner = new Provisioner({
server,
appVersion: window.getVersion(),
});
provisioner = new Provisioner({ server });
}
const cancel = provisioner.subscribe(event => {

View file

@ -1116,7 +1116,7 @@ export default class AccountManager extends EventTarget {
const shouldDownloadBackup =
isBackupEnabled() ||
(isLinkAndSyncEnabled(window.getVersion()) && options.ephemeralBackupKey);
(isLinkAndSyncEnabled() && options.ephemeralBackupKey);
// Set backup download path before storing credentials to ensure that
// storage service and message receiver are not operating

View file

@ -50,7 +50,6 @@ export enum EventKind {
export type ProvisionerOptionsType = Readonly<{
server: WebAPIType;
appVersion: string;
}>;
export type EnvelopeType = ProvisionDecryptResult;
@ -113,7 +112,6 @@ const QR_CODE_TIMEOUTS = [10 * SECOND, 20 * SECOND, 30 * SECOND, 60 * SECOND];
export class Provisioner {
readonly #subscribers = new Set<SubscriberType>();
readonly #server: WebAPIType;
readonly #appVersion: string;
readonly #retryBackOff = new BackOff(FIBONACCI_TIMEOUTS);
#sockets: Array<IWebSocketResource> = [];
@ -121,9 +119,8 @@ export class Provisioner {
#attemptCount = 0;
#isRunning = false;
constructor({ server, appVersion }: ProvisionerOptionsType) {
constructor({ server }: ProvisionerOptionsType) {
this.#server = server;
this.#appVersion = appVersion;
}
public subscribe(notify: SubscribeNotifierType): UnsubscribeFunctionType {
@ -373,7 +370,7 @@ export class Provisioner {
kind: EventKind.Envelope,
envelope,
isLinkAndSync:
isLinkAndSyncEnabled(this.#appVersion) &&
isLinkAndSyncEnabled() &&
Bytes.isNotEmpty(envelope.ephemeralBackupKey),
});
request.respond(200, 'OK');
@ -422,7 +419,7 @@ export class Provisioner {
.toAppUrl({
uuid,
pubKey: Bytes.toBase64(cipher.getPublicKey()),
capabilities: isLinkAndSyncEnabled(this.#appVersion) ? ['backup3'] : [],
capabilities: isLinkAndSyncEnabled() ? ['backup3'] : [],
})
.toString();

View file

@ -1,14 +1,13 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { isProduction } from './version';
import { everDone as wasRegistrationEverDone } from './registration';
export function isLinkAndSyncEnabled(version: string): boolean {
export function isLinkAndSyncEnabled(): boolean {
// Cannot overwrite existing message history
if (wasRegistrationEverDone()) {
return false;
}
return !isProduction(version);
return true;
}