mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-02 00:07:56 +01:00
Remove backup feature flags
This commit is contained in:
@@ -66,8 +66,6 @@ const ScalarKeys = [
|
||||
'desktop.chatFolders.beta',
|
||||
'desktop.chatFolders.prod',
|
||||
'desktop.clientExpiration',
|
||||
'desktop.backups.beta',
|
||||
'desktop.backups.prod',
|
||||
'desktop.internalUser',
|
||||
'desktop.loggingErrorToasts',
|
||||
'desktop.mediaQuality.levels',
|
||||
|
||||
@@ -411,7 +411,6 @@ export default {
|
||||
availableLocales: ['en'],
|
||||
availableMicrophones,
|
||||
availableSpeakers,
|
||||
backupFeatureEnabled: false,
|
||||
chatFoldersFeatureEnabled: true,
|
||||
backupFreeMediaDays: 45,
|
||||
backupKeyViewed: false,
|
||||
@@ -1034,7 +1033,6 @@ PNPDiscoverabilityDisabled.args = {
|
||||
export const BackupDetailsMediaDownloadActive = Template.bind({});
|
||||
BackupDetailsMediaDownloadActive.args = {
|
||||
settingsLocation: { page: SettingsPage.BackupsDetails },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
cloudBackupStatus: {
|
||||
protoSize: 100_000_000,
|
||||
@@ -1059,7 +1057,6 @@ BackupDetailsMediaDownloadActive.args = {
|
||||
export const BackupDetailsMediaDownloadPaused = Template.bind({});
|
||||
BackupDetailsMediaDownloadPaused.args = {
|
||||
settingsLocation: { page: SettingsPage.BackupsDetails },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
cloudBackupStatus: {
|
||||
protoSize: 100_000_000,
|
||||
@@ -1085,7 +1082,6 @@ BackupDetailsMediaDownloadPaused.args = {
|
||||
export const BackupDetailsFree = Template.bind({});
|
||||
BackupDetailsFree.args = {
|
||||
settingsLocation: { page: SettingsPage.BackupsDetails },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
cloudBackupStatus: {
|
||||
protoSize: 100_000_000,
|
||||
@@ -1102,7 +1098,6 @@ export const BackupsPaidActive = Template.bind({});
|
||||
BackupsPaidActive.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupTier: BackupLevel.Paid,
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
cloudBackupStatus: {
|
||||
protoSize: 100_000_000,
|
||||
@@ -1122,7 +1117,6 @@ export const BackupsPaidLoadingSubscription = Template.bind({});
|
||||
BackupsPaidLoadingSubscription.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupTier: BackupLevel.Paid,
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
cloudBackupStatus: {
|
||||
protoSize: 100_000_000,
|
||||
@@ -1144,7 +1138,6 @@ export const BackupsPaidLoadingFirstTime = Template.bind({});
|
||||
BackupsPaidLoadingFirstTime.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupTier: BackupLevel.Paid,
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
cloudBackupStatus: {
|
||||
protoSize: 100_000_000,
|
||||
@@ -1159,7 +1152,6 @@ BackupsPaidLoadingFirstTime.args = {
|
||||
export const BackupsPaidCanceled = Template.bind({});
|
||||
BackupsPaidCanceled.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
backupTier: BackupLevel.Paid,
|
||||
cloudBackupStatus: {
|
||||
@@ -1180,13 +1172,11 @@ export const BackupsFree = Template.bind({});
|
||||
BackupsFree.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupTier: BackupLevel.Free,
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
};
|
||||
export const BackupsFreeNoLocal = Template.bind({});
|
||||
BackupsFreeNoLocal.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: false,
|
||||
backupTier: BackupLevel.Free,
|
||||
};
|
||||
@@ -1194,7 +1184,6 @@ BackupsFreeNoLocal.args = {
|
||||
export const BackupsOff = Template.bind({});
|
||||
BackupsOff.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
backupTier: null,
|
||||
};
|
||||
@@ -1202,21 +1191,18 @@ BackupsOff.args = {
|
||||
export const BackupsLocalBackups = Template.bind({});
|
||||
BackupsLocalBackups.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
};
|
||||
|
||||
export const BackupsRemoteEnabledLocalDisabled = Template.bind({});
|
||||
BackupsRemoteEnabledLocalDisabled.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: false,
|
||||
};
|
||||
|
||||
export const BackupsPaidSubscriptionNotFound = Template.bind({});
|
||||
BackupsPaidSubscriptionNotFound.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
backupSubscriptionStatus: {
|
||||
status: 'not-found',
|
||||
@@ -1231,7 +1217,6 @@ BackupsPaidSubscriptionNotFound.args = {
|
||||
export const BackupsSubscriptionExpired = Template.bind({});
|
||||
BackupsSubscriptionExpired.args = {
|
||||
settingsLocation: { page: SettingsPage.Backups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
backupTier: null,
|
||||
backupSubscriptionStatus: {
|
||||
@@ -1242,7 +1227,6 @@ BackupsSubscriptionExpired.args = {
|
||||
export const LocalBackups = Template.bind({});
|
||||
LocalBackups.args = {
|
||||
settingsLocation: { page: SettingsPage.LocalBackups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
backupKeyViewed: true,
|
||||
lastLocalBackup: {
|
||||
@@ -1256,7 +1240,6 @@ LocalBackups.args = {
|
||||
export const LocalBackupsNeverBackedUp = Template.bind({});
|
||||
LocalBackupsNeverBackedUp.args = {
|
||||
settingsLocation: { page: SettingsPage.LocalBackups },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
backupKeyViewed: true,
|
||||
lastLocalBackup: undefined,
|
||||
@@ -1266,14 +1249,12 @@ LocalBackupsNeverBackedUp.args = {
|
||||
export const LocalBackupsSetupChooseFolder = Template.bind({});
|
||||
LocalBackupsSetupChooseFolder.args = {
|
||||
settingsLocation: { page: SettingsPage.LocalBackupsSetupFolder },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
};
|
||||
|
||||
export const LocalBackupsSetupViewBackupKey = Template.bind({});
|
||||
LocalBackupsSetupViewBackupKey.args = {
|
||||
settingsLocation: { page: SettingsPage.LocalBackupsSetupKey },
|
||||
backupFeatureEnabled: true,
|
||||
backupLocalBackupsEnabled: true,
|
||||
localBackupFolder: '/home/signaluser/Signal Backups/',
|
||||
};
|
||||
|
||||
@@ -112,7 +112,6 @@ export type PropsDataType = {
|
||||
// Settings
|
||||
accountEntropyPool: string | undefined;
|
||||
autoDownloadAttachment: AutoDownloadAttachmentType;
|
||||
backupFeatureEnabled: boolean;
|
||||
backupFreeMediaDays: number;
|
||||
backupKeyViewed: boolean;
|
||||
backupLocalBackupsEnabled: boolean;
|
||||
@@ -385,7 +384,6 @@ export function Preferences({
|
||||
availableLocales,
|
||||
availableMicrophones,
|
||||
availableSpeakers,
|
||||
backupFeatureEnabled,
|
||||
backupMediaDownloadStatus,
|
||||
chatFoldersFeatureEnabled,
|
||||
pauseBackupMediaDownload,
|
||||
@@ -588,15 +586,7 @@ export function Preferences({
|
||||
setLanguageDialog(null);
|
||||
setSelectedLanguageLocale(localeOverride);
|
||||
}
|
||||
const shouldShowBackupsPage =
|
||||
backupFeatureEnabled || backupLocalBackupsEnabled;
|
||||
|
||||
if (
|
||||
settingsLocation.page === SettingsPage.Backups &&
|
||||
!shouldShowBackupsPage
|
||||
) {
|
||||
setSettingsLocation({ page: SettingsPage.General });
|
||||
}
|
||||
if (settingsLocation.page === SettingsPage.Internal && !isInternalUser) {
|
||||
setSettingsLocation({ page: SettingsPage.General });
|
||||
}
|
||||
@@ -2282,7 +2272,6 @@ export function Preferences({
|
||||
cloudBackupStatus={cloudBackupStatus}
|
||||
i18n={i18n}
|
||||
isLocalBackupsEnabled={backupLocalBackupsEnabled}
|
||||
isRemoteBackupsEnabled={backupFeatureEnabled}
|
||||
lastLocalBackup={lastLocalBackup}
|
||||
locale={resolvedLocale}
|
||||
localBackupFolder={localBackupFolder}
|
||||
@@ -2534,23 +2523,21 @@ export function Preferences({
|
||||
>
|
||||
{i18n('icu:Preferences__button--data-usage')}
|
||||
</button>
|
||||
{shouldShowBackupsPage ? (
|
||||
<button
|
||||
type="button"
|
||||
className={classNames({
|
||||
Preferences__button: true,
|
||||
'Preferences__button--backups': true,
|
||||
'Preferences__button--selected': isBackupPage(
|
||||
settingsLocation.page
|
||||
),
|
||||
})}
|
||||
onClick={() =>
|
||||
setSettingsLocation({ page: SettingsPage.Backups })
|
||||
}
|
||||
>
|
||||
{i18n('icu:Preferences__button--backups')}
|
||||
</button>
|
||||
) : null}
|
||||
<button
|
||||
type="button"
|
||||
className={classNames({
|
||||
Preferences__button: true,
|
||||
'Preferences__button--backups': true,
|
||||
'Preferences__button--selected': isBackupPage(
|
||||
settingsLocation.page
|
||||
),
|
||||
})}
|
||||
onClick={() =>
|
||||
setSettingsLocation({ page: SettingsPage.Backups })
|
||||
}
|
||||
>
|
||||
{i18n('icu:Preferences__button--backups')}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={classNames({
|
||||
|
||||
@@ -44,14 +44,11 @@ const LOCAL_BACKUPS_PAGES = new Set([
|
||||
SettingsPage.LocalBackupsSetupFolder,
|
||||
SettingsPage.LocalBackupsSetupKey,
|
||||
]);
|
||||
const REMOTE_BACKUPS_PAGES = new Set([SettingsPage.BackupsDetails]);
|
||||
|
||||
function isLocalBackupsPage(page: SettingsPage) {
|
||||
return LOCAL_BACKUPS_PAGES.has(page);
|
||||
}
|
||||
function isRemoteBackupsPage(page: SettingsPage) {
|
||||
return REMOTE_BACKUPS_PAGES.has(page);
|
||||
}
|
||||
|
||||
export function PreferencesBackups({
|
||||
accountEntropyPool,
|
||||
backupFreeMediaDays,
|
||||
@@ -61,7 +58,6 @@ export function PreferencesBackups({
|
||||
cloudBackupStatus,
|
||||
i18n,
|
||||
isLocalBackupsEnabled,
|
||||
isRemoteBackupsEnabled,
|
||||
lastLocalBackup,
|
||||
locale,
|
||||
localBackupFolder,
|
||||
@@ -88,7 +84,6 @@ export function PreferencesBackups({
|
||||
localBackupFolder: string | undefined;
|
||||
i18n: LocalizerType;
|
||||
isLocalBackupsEnabled: boolean;
|
||||
isRemoteBackupsEnabled: boolean;
|
||||
lastLocalBackup: LocalBackupExportMetadata | undefined;
|
||||
locale: string;
|
||||
onBackupKeyViewedChange: (keyViewed: boolean) => void;
|
||||
@@ -124,11 +119,6 @@ export function PreferencesBackups({
|
||||
refreshCloudBackupStatus,
|
||||
]);
|
||||
|
||||
if (!isRemoteBackupsEnabled && isRemoteBackupsPage(settingsLocation.page)) {
|
||||
setSettingsLocation({ page: SettingsPage.Backups });
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!isLocalBackupsEnabled && isLocalBackupsPage(settingsLocation.page)) {
|
||||
setSettingsLocation({ page: SettingsPage.Backups });
|
||||
return null;
|
||||
@@ -335,8 +325,7 @@ export function PreferencesBackups({
|
||||
{i18n('icu:Preferences--backup-section-description')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isRemoteBackupsEnabled ? renderRemoteBackups() : null}
|
||||
{renderRemoteBackups()}
|
||||
{isLocalBackupsEnabled ? renderLocalBackups() : null}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -29,7 +29,6 @@ import {
|
||||
setPhoneNumberDiscoverability,
|
||||
} from '../../textsecure/WebAPI.preload.js';
|
||||
import { DEFAULT_CONVERSATION_COLOR } from '../../types/Colors.std.js';
|
||||
import { isBackupFeatureEnabled } from '../../util/isBackupEnabled.preload.js';
|
||||
import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js';
|
||||
import { saveAttachmentToDisk } from '../../util/migrations.preload.js';
|
||||
import { format } from '../../types/PhoneNumber.std.js';
|
||||
@@ -581,7 +580,6 @@ export function SmartPreferences(): React.JSX.Element | null {
|
||||
Settings.isContentProtectionSupported(OS);
|
||||
const isContentProtectionNeeded = Settings.isContentProtectionNeeded(OS);
|
||||
|
||||
const backupFeatureEnabled = isBackupFeatureEnabled(items.remoteConfig);
|
||||
const backupLocalBackupsEnabled = isLocalBackupsEnabled(items.remoteConfig);
|
||||
const backupFreeMediaDays = getMessageQueueTime(items.remoteConfig) / DAY;
|
||||
|
||||
@@ -808,7 +806,6 @@ export function SmartPreferences(): React.JSX.Element | null {
|
||||
availableLocales={availableLocales}
|
||||
availableMicrophones={availableMicrophones}
|
||||
availableSpeakers={availableSpeakers}
|
||||
backupFeatureEnabled={backupFeatureEnabled}
|
||||
backupKeyViewed={backupKeyViewed}
|
||||
backupTier={backupLevelFromNumber(backupTier)}
|
||||
backupSubscriptionStatus={
|
||||
|
||||
@@ -1,35 +1,14 @@
|
||||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as RemoteConfig from '../RemoteConfig.dom.js';
|
||||
import { isTestOrMockEnvironment } from '../environment.std.js';
|
||||
import { isStagingServer } from './isStagingServer.dom.js';
|
||||
import { isBeta, isNightly } from './version.std.js';
|
||||
import { itemStorage } from '../textsecure/Storage.preload.js';
|
||||
|
||||
export function areRemoteBackupsTurnedOn(): boolean {
|
||||
return isBackupFeatureEnabled() && itemStorage.get('backupTier') != null;
|
||||
return itemStorage.get('backupTier') != null;
|
||||
}
|
||||
|
||||
// Downloading from a remote backup is currently a test-only feature
|
||||
export function canAttemptRemoteBackupDownload(): boolean {
|
||||
return isBackupFeatureEnabled() && isTestOrMockEnvironment();
|
||||
}
|
||||
|
||||
export function isBackupFeatureEnabled(
|
||||
reduxConfig?: RemoteConfig.ConfigMapType
|
||||
): boolean {
|
||||
if (isStagingServer() || isTestOrMockEnvironment()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isNightly(window.getVersion())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isBeta(window.getVersion())) {
|
||||
return RemoteConfig.isEnabled('desktop.backups.beta', reduxConfig);
|
||||
}
|
||||
|
||||
return Boolean(RemoteConfig.isEnabled('desktop.backups.prod', reduxConfig));
|
||||
return isTestOrMockEnvironment();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user