Remove desktop.deleteSync from RemoteConfig

This commit is contained in:
Fedor Indutny 2024-07-23 09:58:40 -07:00 committed by GitHub
parent c70a8955f9
commit 06f9c4ffe1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 4 additions and 22 deletions

View file

@ -20,8 +20,6 @@ export type ConfigKeyType =
| 'desktop.calling.raiseHand'
| 'desktop.clientExpiration'
| 'desktop.backup.credentialFetch'
| 'desktop.deleteSync.send'
| 'desktop.deleteSync.receive'
| 'desktop.internalUser'
| 'desktop.mediaQuality.levels'
| 'desktop.messageCleanup'

View file

@ -205,7 +205,6 @@ import { queueSyncTasks } from './util/syncTasks';
import type { ViewSyncTaskType } from './messageModifiers/ViewSyncs';
import type { ReceiptSyncTaskType } from './messageModifiers/MessageReceipts';
import type { ReadSyncTaskType } from './messageModifiers/ReadSyncs';
import { isEnabled } from './RemoteConfig';
import { AttachmentBackupManager } from './jobs/AttachmentBackupManager';
import { getConversationIdForLogging } from './util/idForLogging';
import { encryptConversationAttachments } from './util/encryptConversationAttachments';
@ -3557,11 +3556,6 @@ export async function startApp(): Promise<void> {
const { confirm, timestamp, envelopeId, deleteForMeSync } = ev;
const logId = `onDeleteForMeSync(${timestamp})`;
if (!isEnabled('desktop.deleteSync.receive')) {
confirm();
return;
}
// The user clearly knows about this feature; they did it on another device!
drop(window.storage.put('localDeleteWarningShown', true));

View file

@ -178,7 +178,6 @@ import {
getConversationToDelete,
getMessageToDelete,
} from '../util/deleteForMe';
import { isEnabled } from '../RemoteConfig';
import { getCallHistorySelector } from '../state/selectors/callHistory';
/* eslint-disable more/no-then */
@ -5047,11 +5046,7 @@ export class ConversationModel extends window.Backbone
const ourConversation =
window.ConversationController.getOurConversationOrThrow();
const capable = Boolean(ourConversation.get('capabilities')?.deleteSync);
if (
source === 'local-delete' &&
capable &&
isEnabled('desktop.deleteSync.send')
) {
if (source === 'local-delete' && capable) {
log.info(`${logId}: Preparing sync message`);
const timestamp = Date.now();

View file

@ -196,7 +196,6 @@ import {
getMessageToDelete,
} from '../../util/deleteForMe';
import { MAX_MESSAGE_COUNT } from '../../util/deleteForMe.types';
import { isEnabled } from '../../RemoteConfig';
import { markCallHistoryReadInConversation } from './callHistory';
import type { CapabilitiesType } from '../../textsecure/WebAPI';
@ -1778,7 +1777,7 @@ function deleteMessages({
window.ConversationController.getOurConversationOrThrow();
const capable = Boolean(ourConversation.get('capabilities')?.deleteSync);
if (!capable || !isEnabled('desktop.deleteSync.send')) {
if (!capable) {
return;
}
if (messages.length === 0) {

View file

@ -5,20 +5,16 @@ import { createSelector } from 'reselect';
import { getUserACI } from './user';
import { getConversationSelector } from './conversations';
import { getRemoteConfig, isRemoteConfigFlagEnabled } from './items';
import type { AciString } from '../../types/ServiceId';
import type { ConfigMapType } from '../../RemoteConfig';
import type { GetConversationByIdType } from './conversations';
export const getDeleteSyncSendEnabled = createSelector(
getUserACI,
getConversationSelector,
getRemoteConfig,
(
aci: AciString | undefined,
conversationSelector: GetConversationByIdType,
remoteConfig: ConfigMapType
conversationSelector: GetConversationByIdType
): boolean => {
if (!aci) {
return false;
@ -33,6 +29,6 @@ export const getDeleteSyncSendEnabled = createSelector(
return false;
}
return isRemoteConfigFlagEnabled(remoteConfig, 'desktop.deleteSync.send');
return true;
}
);