Disable link-and-sync in Alpha

This commit is contained in:
Fedor Indutny 2024-10-21 13:06:22 -07:00 committed by GitHub
parent 9c99796937
commit 2ec79f5712
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 9 deletions

View file

@ -196,7 +196,7 @@ function startInstaller(): ThunkAction<
const { server } = window.textsecure; const { server } = window.textsecure;
strictAssert(server, 'Expected a server'); strictAssert(server, 'Expected a server');
const provisioner = new Provisioner(server, window.getVersion()); const provisioner = new Provisioner(server);
const abortController = new AbortController(); const abortController = new AbortController();
const { signal } = abortController; const { signal } = abortController;

View file

@ -78,10 +78,7 @@ export class Provisioner {
private state: StateType = { step: Step.Idle }; private state: StateType = { step: Step.Idle };
private wsr: IWebSocketResource | undefined; private wsr: IWebSocketResource | undefined;
constructor( constructor(private readonly server: WebAPIType) {}
private readonly server: WebAPIType,
private readonly appVersion: string
) {}
public close(error = new Error('Provisioner closed')): void { public close(error = new Error('Provisioner closed')): void {
try { try {
@ -245,7 +242,7 @@ export class Provisioner {
.toAppUrl({ .toAppUrl({
uuid, uuid,
pubKey: Bytes.toBase64(pubKey), pubKey: Bytes.toBase64(pubKey),
capabilities: isLinkAndSyncEnabled(this.appVersion) ? ['backup'] : [], capabilities: isLinkAndSyncEnabled() ? ['backup'] : [],
}) })
.toString(); .toString();

View file

@ -3,14 +3,13 @@
import { isTestOrMockEnvironment } from '../environment'; import { isTestOrMockEnvironment } from '../environment';
import { isStagingServer } from './isStagingServer'; import { isStagingServer } from './isStagingServer';
import { isAlpha } from './version';
import { everDone as wasRegistrationEverDone } from './registration'; import { everDone as wasRegistrationEverDone } from './registration';
export function isLinkAndSyncEnabled(version: string): boolean { export function isLinkAndSyncEnabled(): boolean {
// Cannot overwrite existing message history // Cannot overwrite existing message history
if (wasRegistrationEverDone()) { if (wasRegistrationEverDone()) {
return false; return false;
} }
return isStagingServer() || isTestOrMockEnvironment() || isAlpha(version); return isStagingServer() || isTestOrMockEnvironment();
} }