Introduce new remote flag for storage service write behavior

This commit is contained in:
Scott Nonnenberg 2020-09-10 10:59:59 -07:00 committed by GitHub
parent b2634d1cb9
commit 4c98b4a96f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View file

@ -3084,6 +3084,14 @@
// [X] whitelisted
// [X] archived
captureChange() {
if (!window.Signal.RemoteConfig.isEnabled('desktop.storageWrite')) {
window.log.info(
'conversation.captureChange: Returning early; desktop.storageWrite is falsey'
);
return;
}
this.set({ needsStorageServiceSync: true });
this.queueJob(() => {

View file

@ -6,6 +6,7 @@ type ConfigKeyType =
| 'desktop.gv2'
| 'desktop.cds'
| 'desktop.storage'
| 'desktop.storageWrite'
| 'desktop.clientExpiration';
type ConfigValueType = {
name: ConfigKeyType;

View file

@ -665,6 +665,10 @@ async function processManifest(
export async function runStorageServiceSyncJob(): Promise<void> {
if (!isEnabled('desktop.storage')) {
window.log.info(
'storageService.runStorageServiceSyncJob: Not starting desktop.storage is falsey'
);
return;
}
@ -738,6 +742,17 @@ export async function eraseAllStorageServiceState(): Promise<void> {
async function nondebouncedStorageServiceUploadJob(): Promise<void> {
if (!isEnabled('desktop.storage')) {
window.log.info(
'storageService.storageServiceUploadJob: Not starting desktop.storage is falsey'
);
return;
}
if (!isEnabled('desktop.storageWrite')) {
window.log.info(
'storageService.storageServiceUploadJob: Not starting desktop.storageWrite is falsey'
);
return;
}