Enable storage service for everyone
This commit is contained in:
parent
5fdfa1c632
commit
3eff5b73d2
|
@ -16,7 +16,6 @@ import {
|
||||||
} from '../../util/libphonenumberInstance';
|
} from '../../util/libphonenumberInstance';
|
||||||
import { assert } from '../../util/assert';
|
import { assert } from '../../util/assert';
|
||||||
import { missingCaseError } from '../../util/missingCaseError';
|
import { missingCaseError } from '../../util/missingCaseError';
|
||||||
import { isStorageWriteFeatureEnabled } from '../../storage/isFeatureEnabled';
|
|
||||||
|
|
||||||
export type LeftPaneComposePropsType = {
|
export type LeftPaneComposePropsType = {
|
||||||
composeContacts: ReadonlyArray<ContactListItemPropsType>;
|
composeContacts: ReadonlyArray<ContactListItemPropsType>;
|
||||||
|
@ -229,7 +228,7 @@ export class LeftPaneComposeHelper extends LeftPaneHelper<LeftPaneComposePropsTy
|
||||||
if (this.phoneNumber) {
|
if (this.phoneNumber) {
|
||||||
return TopButton.StartNewConversation;
|
return TopButton.StartNewConversation;
|
||||||
}
|
}
|
||||||
if (this.searchTerm || !isStorageWriteFeatureEnabled()) {
|
if (this.searchTerm) {
|
||||||
return TopButton.None;
|
return TopButton.None;
|
||||||
}
|
}
|
||||||
return TopButton.CreateNewGroup;
|
return TopButton.CreateNewGroup;
|
||||||
|
|
|
@ -19,7 +19,6 @@ import {
|
||||||
GROUP_CREDENTIALS_KEY,
|
GROUP_CREDENTIALS_KEY,
|
||||||
maybeFetchNewCredentials,
|
maybeFetchNewCredentials,
|
||||||
} from './services/groupCredentialFetcher';
|
} from './services/groupCredentialFetcher';
|
||||||
import { isStorageWriteFeatureEnabled } from './storage/isFeatureEnabled';
|
|
||||||
import dataInterface from './sql/Client';
|
import dataInterface from './sql/Client';
|
||||||
import { toWebSafeBase64, fromWebSafeBase64 } from './util/webSafeBase64';
|
import { toWebSafeBase64, fromWebSafeBase64 } from './util/webSafeBase64';
|
||||||
import { assert, strictAssert } from './util/assert';
|
import { assert, strictAssert } from './util/assert';
|
||||||
|
@ -1500,12 +1499,6 @@ export async function createGroupV2({
|
||||||
// Ensure we have the credentials we need before attempting GroupsV2 operations
|
// Ensure we have the credentials we need before attempting GroupsV2 operations
|
||||||
await maybeFetchNewCredentials();
|
await maybeFetchNewCredentials();
|
||||||
|
|
||||||
if (!isStorageWriteFeatureEnabled()) {
|
|
||||||
throw new Error(
|
|
||||||
'createGroupV2: storage service write is not enabled. Cannot create the group'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const ACCESS_ENUM = Proto.AccessControl.AccessRequired;
|
const ACCESS_ENUM = Proto.AccessControl.AccessRequired;
|
||||||
const MEMBER_ROLE_ENUM = Proto.Member.Role;
|
const MEMBER_ROLE_ENUM = Proto.Member.Role;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ import { storageJobQueue } from '../util/JobQueue';
|
||||||
import { sleep } from '../util/sleep';
|
import { sleep } from '../util/sleep';
|
||||||
import { isMoreRecentThan } from '../util/timestamp';
|
import { isMoreRecentThan } from '../util/timestamp';
|
||||||
import { normalizeNumber } from '../util/normalizeNumber';
|
import { normalizeNumber } from '../util/normalizeNumber';
|
||||||
import { isStorageWriteFeatureEnabled } from '../storage/isFeatureEnabled';
|
|
||||||
import { ourProfileKeyService } from './ourProfileKey';
|
import { ourProfileKeyService } from './ourProfileKey';
|
||||||
import {
|
import {
|
||||||
ConversationTypes,
|
ConversationTypes,
|
||||||
|
@ -1019,12 +1018,6 @@ async function processRemoteRecords(
|
||||||
async function sync(
|
async function sync(
|
||||||
ignoreConflicts = false
|
ignoreConflicts = false
|
||||||
): Promise<Proto.ManifestRecord | undefined> {
|
): Promise<Proto.ManifestRecord | undefined> {
|
||||||
if (!isStorageWriteFeatureEnabled()) {
|
|
||||||
log.info('storageService.sync: Not starting desktop.storage is falsey');
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!window.storage.get('storageKey')) {
|
if (!window.storage.get('storageKey')) {
|
||||||
throw new Error('storageService.sync: Cannot start; no storage key!');
|
throw new Error('storageService.sync: Cannot start; no storage key!');
|
||||||
}
|
}
|
||||||
|
@ -1081,14 +1074,6 @@ async function sync(
|
||||||
}
|
}
|
||||||
|
|
||||||
async function upload(fromSync = false): Promise<void> {
|
async function upload(fromSync = false): Promise<void> {
|
||||||
if (!isStorageWriteFeatureEnabled()) {
|
|
||||||
log.info(
|
|
||||||
'storageService.upload: Not starting because the feature is not enabled'
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!window.textsecure.messaging) {
|
if (!window.textsecure.messaging) {
|
||||||
throw new Error('storageService.upload: We are offline!');
|
throw new Error('storageService.upload: We are offline!');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
// Copyright 2021 Signal Messenger, LLC
|
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
import { isEnabled } from '../RemoteConfig';
|
|
||||||
|
|
||||||
function isStorageFeatureEnabled(): boolean {
|
|
||||||
return isEnabled('desktop.storage');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isStorageWriteFeatureEnabled(): boolean {
|
|
||||||
return isStorageFeatureEnabled() && isEnabled('desktop.storageWrite3');
|
|
||||||
}
|
|
Loading…
Reference in a new issue