From 36f1e2040040bf53109f95441bed68ae1365c520 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 17 Mar 2026 18:34:29 -0700 Subject: [PATCH] Cleanup released remote config flags --- ts/RemoteConfig.dom.ts | 13 --- ts/background.preload.ts | 21 ----- ts/components/LeftPane.dom.stories.tsx | 1 - ts/components/LeftPane.dom.tsx | 6 +- ts/components/Preferences.dom.stories.tsx | 2 - ts/components/Preferences.dom.tsx | 90 +++++++++---------- ts/components/PreferencesDonateFlow.dom.tsx | 11 +-- ts/components/PreferencesDonations.dom.tsx | 3 - ts/services/megaphone.preload.ts | 13 --- .../releaseNoteAndMegaphoneFetcher.preload.ts | 23 +++-- ts/state/selectors/conversations.dom.ts | 2 - ts/state/selectors/message.preload.ts | 4 - ts/state/smart/LeftPane.preload.tsx | 3 - .../smart/LeftPaneChatFolders.preload.tsx | 6 -- ts/state/smart/Preferences.preload.tsx | 2 - .../smart/PreferencesDonations.preload.tsx | 20 +---- ts/util/callQualitySurvey.dom.ts | 14 +-- ts/util/isChatFoldersEnabled.dom.ts | 33 ------- ts/util/isPinnedMessagesEnabled.dom.ts | 18 ---- 19 files changed, 59 insertions(+), 226 deletions(-) delete mode 100644 ts/util/isChatFoldersEnabled.dom.ts delete mode 100644 ts/util/isPinnedMessagesEnabled.dom.ts diff --git a/ts/RemoteConfig.dom.ts b/ts/RemoteConfig.dom.ts index becc942c8c..313abcda48 100644 --- a/ts/RemoteConfig.dom.ts +++ b/ts/RemoteConfig.dom.ts @@ -36,26 +36,16 @@ const SemverKeys = [ 'desktop.adminDelete.send.prod', 'desktop.binaryServiceId.beta', 'desktop.binaryServiceId.prod', - 'desktop.callQualitySurvey.beta', - 'desktop.callQualitySurvey.prod', - 'desktop.donationPaypal.beta', - 'desktop.donationPaypal.prod', 'desktop.groupMemberLabels.edit.beta', 'desktop.groupMemberLabels.edit.prod', 'desktop.keyTransparency.beta', 'desktop.keyTransparency.prod', 'desktop.localBackups.beta', 'desktop.localBackups.prod', - 'desktop.pinnedMessages.receive.beta', - 'desktop.pinnedMessages.receive.prod', - 'desktop.pinnedMessages.send.beta', - 'desktop.pinnedMessages.send.prod', 'desktop.plaintextExport.beta', 'desktop.plaintextExport.prod', 'desktop.pollSend1to1.beta', 'desktop.pollSend1to1.prod', - 'desktop.remoteMegaphone.beta', - 'desktop.remoteMegaphone.prod', 'desktop.remoteMute.send.beta', 'desktop.remoteMute.send.prod', 'desktop.retireAccessKeyGroupSend.beta', @@ -66,9 +56,6 @@ export type SemverKeyType = ArrayValues; const ScalarKeys = [ 'desktop.callQualitySurveyPPM', - 'desktop.chatFolders.alpha', - 'desktop.chatFolders.beta', - 'desktop.chatFolders.prod', 'desktop.clientExpiration', 'desktop.internalUser', 'desktop.loggingErrorToasts', diff --git a/ts/background.preload.ts b/ts/background.preload.ts index 008a08f7bf..9d5ac8593e 100644 --- a/ts/background.preload.ts +++ b/ts/background.preload.ts @@ -282,7 +282,6 @@ import { } from './types/Message2.preload.js'; import { JobCancelReason } from './jobs/types.std.js'; import { itemStorage } from './textsecure/Storage.preload.js'; -import { isPinnedMessagesReceiveEnabled } from './util/isPinnedMessagesEnabled.dom.js'; import { initMessageCleanup } from './services/messageStateCleanup.dom.js'; import { MessageCache } from './services/MessageCache.preload.js'; import { saveAndNotify } from './messages/saveAndNotify.preload.js'; @@ -2510,11 +2509,6 @@ export async function startApp(): Promise { } if (data.message.pinMessage != null) { - if (!isPinnedMessagesReceiveEnabled()) { - log.warn('Dropping PinMessage because the flag is disabled'); - confirm(); - return; - } await PinnedMessages.onPinnedMessageAdd({ targetSentTimestamp: data.message.pinMessage.targetSentTimestamp, targetAuthorAci: data.message.pinMessage.targetAuthorAci, @@ -2700,11 +2694,6 @@ export async function startApp(): Promise { } if (data.message.unpinMessage != null) { - if (!isPinnedMessagesReceiveEnabled()) { - log.warn('Dropping UnpinMessage because the flag is disabled'); - confirm(); - return; - } await PinnedMessages.onPinnedMessageRemove({ targetSentTimestamp: data.message.unpinMessage.targetSentTimestamp, targetAuthorAci: data.message.unpinMessage.targetAuthorAci, @@ -3070,11 +3059,6 @@ export async function startApp(): Promise { } if (data.message.pinMessage != null) { - if (!isPinnedMessagesReceiveEnabled()) { - log.warn('Dropping PinMessage because the flag is disabled'); - confirm(); - return; - } strictAssert(data.timestamp != null, 'Missing sent timestamp'); await PinnedMessages.onPinnedMessageAdd({ targetSentTimestamp: data.message.pinMessage.targetSentTimestamp, @@ -3262,11 +3246,6 @@ export async function startApp(): Promise { } if (data.message.unpinMessage != null) { - if (!isPinnedMessagesReceiveEnabled()) { - log.warn('Dropping UnpinMessage because the flag is disabled'); - confirm(); - return; - } await PinnedMessages.onPinnedMessageRemove({ targetSentTimestamp: data.message.unpinMessage.targetSentTimestamp, targetAuthorAci: data.message.unpinMessage.targetAuthorAci, diff --git a/ts/components/LeftPane.dom.stories.tsx b/ts/components/LeftPane.dom.stories.tsx index a97fe72f5b..8c3b05468c 100644 --- a/ts/components/LeftPane.dom.stories.tsx +++ b/ts/components/LeftPane.dom.stories.tsx @@ -207,7 +207,6 @@ const useProps = (overrideProps: OverridePropsType = {}): PropsType => { usernameLinkCorrupted: false, isUpdateDownloaded, isNotificationProfileActive: false, - isChatFoldersEnabled: true, navTabsCollapsed: false, setChallengeStatus: action('setChallengeStatus'), diff --git a/ts/components/LeftPane.dom.tsx b/ts/components/LeftPane.dom.tsx index 7be46bbf0e..76cf71e573 100644 --- a/ts/components/LeftPane.dom.tsx +++ b/ts/components/LeftPane.dom.tsx @@ -127,7 +127,6 @@ export type PropsType = { i18n: LocalizerType; isMacOS: boolean; isNotificationProfileActive: boolean; - isChatFoldersEnabled: boolean; preferredWidthFromStorage: number; selectedChatFolder: ChatFolder | null; selectedConversationId: undefined | string; @@ -248,7 +247,6 @@ export function LeftPane({ lookupConversationWithoutServiceId, isMacOS, isNotificationProfileActive, - isChatFoldersEnabled, isOnline, isUpdateDownloaded, modeSpecificProps, @@ -818,7 +816,7 @@ export function LeftPane({ > {i18n('icu:avatarMenuViewArchive')} - {isChatFoldersEnabled && !hasAnyCurrentCustomChatFolders && ( + {!hasAnyCurrentCustomChatFolders && ( )} - {isChatFoldersEnabled && hasAnyCurrentCustomChatFolders && ( + {hasAnyCurrentCustomChatFolders && ( - {chatFoldersFeatureEnabled && ( - - + { + setSettingsLocation({ + page: SettingsPage.ChatFolders, + previousLocation: null, + }); + }} + > + {hasAnyCurrentCustomChatFolders ? i18n( - 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Title--WithChatFolders' + 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Button--WithChatFolders' ) : i18n( - 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Title' - ) - } - description={ - hasAnyCurrentCustomChatFolders - ? i18n( - 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Description--WithChatFolders', - { chatFoldersCount: currentChatFoldersCount } - ) - : i18n( - 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Description' - ) - } - right={ - { - setSettingsLocation({ - page: SettingsPage.ChatFolders, - previousLocation: null, - }); - }} - > - {hasAnyCurrentCustomChatFolders - ? i18n( - 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Button--WithChatFolders' - ) - : i18n( - 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Button' - )} - - } - /> - - )} + 'icu:Preferences__ChatsPage__ChatFoldersSection__AddChatFolderItem__Button' + )} + + } + /> + {isPlaintextExportEnabled && ( diff --git a/ts/components/PreferencesDonateFlow.dom.tsx b/ts/components/PreferencesDonateFlow.dom.tsx index dbbfbb344f..f6a8cb9997 100644 --- a/ts/components/PreferencesDonateFlow.dom.tsx +++ b/ts/components/PreferencesDonateFlow.dom.tsx @@ -86,7 +86,6 @@ const SUPPORT_URL = 'https://support.signal.org/hc/requests/new?desktop'; export type PropsDataType = { i18n: LocalizerType; initialCurrency: string; - isDonationPaypalEnabled: boolean; isOnline: boolean; donationAmountsConfig: ReadonlyDeep | undefined; lastError: DonationErrorType | undefined; @@ -124,7 +123,6 @@ export function PreferencesDonateFlow({ contentsRef, i18n, initialCurrency, - isDonationPaypalEnabled, isOnline, donationAmountsConfig, lastError, @@ -203,13 +201,10 @@ export function PreferencesDonateFlow({ return false; } - return ( - isDonationPaypalEnabled && - donationAmountsConfig[currency].supportedPaymentMethods.includes( - PaymentMethod.Paypal - ) + return donationAmountsConfig[currency].supportedPaymentMethods.includes( + PaymentMethod.Paypal ); - }, [isDonationPaypalEnabled, donationAmountsConfig, currency]); + }, [donationAmountsConfig, currency]); const handleAmountPickerResult = useCallback( (result: AmountPickerResult) => { diff --git a/ts/components/PreferencesDonations.dom.tsx b/ts/components/PreferencesDonations.dom.tsx index 661ee25152..3f52b52db9 100644 --- a/ts/components/PreferencesDonations.dom.tsx +++ b/ts/components/PreferencesDonations.dom.tsx @@ -70,7 +70,6 @@ type PropsExternalType = { export type PropsDataType = { i18n: LocalizerType; initialCurrency: string; - isDonationPaypalEnabled: boolean; isOnline: boolean; settingsLocation: SettingsLocation; didResumeWorkflowAtStartup: boolean; @@ -548,7 +547,6 @@ export function PreferencesDonations({ contentsRef, i18n, initialCurrency, - isDonationPaypalEnabled, isOnline, settingsLocation, workflow, @@ -752,7 +750,6 @@ export function PreferencesDonations({ { try { - if (!isRemoteMegaphoneEnabled()) { - log.info('runMegaphoneCheck: not enabled, skipping'); - return; - } - const megaphones = await DataReader.getAllMegaphones(); const shownIds: Set = new Set(); @@ -92,13 +86,6 @@ export async function runMegaphoneCheck(): Promise { } } -export function isRemoteMegaphoneEnabled(): boolean { - return isFeaturedEnabledNoRedux({ - betaKey: 'desktop.remoteMegaphone.beta', - prodKey: 'desktop.remoteMegaphone.prod', - }); -} - export function isConditionalActive(conditionalId: string | null): boolean { if (conditionalId == null) { return true; diff --git a/ts/services/releaseNoteAndMegaphoneFetcher.preload.ts b/ts/services/releaseNoteAndMegaphoneFetcher.preload.ts index f8598423f2..cc250f0f86 100644 --- a/ts/services/releaseNoteAndMegaphoneFetcher.preload.ts +++ b/ts/services/releaseNoteAndMegaphoneFetcher.preload.ts @@ -48,7 +48,6 @@ import { isCountryPpmCsvBucketEnabled } from '../RemoteConfig.dom.js'; import type { AciString } from '../types/ServiceId.std.js'; import { deleteMegaphoneAndRemoveFromRedux, - isRemoteMegaphoneEnabled, runMegaphoneCheck, } from './megaphone.preload.js'; @@ -574,18 +573,16 @@ export class ReleaseNoteAndMegaphoneFetcher { const manifest = await this.#server.getReleaseNotesManifest(); const currentVersion = window.getVersion(); - if (isRemoteMegaphoneEnabled()) { - // Remote megaphones can be saved prior to desktopMinVersion. - // Saved megaphones are periodically checked to see if we should show them. - const validMegaphones = manifest.megaphones.filter( - (megaphone): megaphone is ManifestMegaphoneType => - megaphone.desktopMinVersion != null - ); - await this.#deleteUnknownMegaphones(validMegaphones); - const savedCount = await this.#saveNewMegaphones(validMegaphones); - if (savedCount > 0) { - drop(runMegaphoneCheck()); - } + // Remote megaphones can be saved prior to desktopMinVersion. + // Saved megaphones are periodically checked to see if we should show them. + const validMegaphones = manifest.megaphones.filter( + (megaphone): megaphone is ManifestMegaphoneType => + megaphone.desktopMinVersion != null + ); + await this.#deleteUnknownMegaphones(validMegaphones); + const savedCount = await this.#saveNewMegaphones(validMegaphones); + if (savedCount > 0) { + drop(runMegaphoneCheck()); } const validNotes = manifest.announcements.filter( diff --git a/ts/state/selectors/conversations.dom.ts b/ts/state/selectors/conversations.dom.ts index 432d7886b8..4d2ac2f5b7 100644 --- a/ts/state/selectors/conversations.dom.ts +++ b/ts/state/selectors/conversations.dom.ts @@ -77,7 +77,6 @@ import { type ChatFolder, isConversationInChatFolder, } from '../../types/ChatFolder.std.js'; -import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; import { getSelectedChatFolder, getCurrentChatFolders, @@ -458,7 +457,6 @@ export const _getLeftPaneLists = ({ for (let conversation of Object.values(conversationLookup)) { if ( - isChatFoldersEnabled(window.SignalContext.getVersion()) && !_shouldIncludeInChatFolder( conversation, selectedChatFolder, diff --git a/ts/state/selectors/message.preload.ts b/ts/state/selectors/message.preload.ts index a867c8414e..4fc2baa230 100644 --- a/ts/state/selectors/message.preload.ts +++ b/ts/state/selectors/message.preload.ts @@ -176,7 +176,6 @@ import { getCallIdFromEra } from '../../util/callDisposition.preload.js'; import { LONG_MESSAGE } from '../../types/MIME.std.js'; import type { MessageRequestResponseNotificationData } from '../../components/conversation/MessageRequestResponseNotification.dom.js'; import type { PinnedMessageNotificationData } from '../../components/conversation/pinned-messages/PinnedMessageNotification.dom.js'; -import { isPinnedMessagesSendEnabled } from '../../util/isPinnedMessagesEnabled.dom.js'; import type { PollTerminateNotificationDataType } from '../../components/conversation/PollTerminateNotification.dom.js'; const { groupBy, isEmpty, isNumber, isObject, map } = lodash; @@ -2618,9 +2617,6 @@ export function canForward(message: ReadonlyMessageAttributesType): boolean { } export function canPinMessages(conversation: ConversationType): boolean { - if (!isPinnedMessagesSendEnabled()) { - return false; - } return ( conversation.type === 'direct' || conversation.canEditGroupInfo === true ); diff --git a/ts/state/smart/LeftPane.preload.tsx b/ts/state/smart/LeftPane.preload.tsx index bdf25ed718..66d2f8ecf1 100644 --- a/ts/state/smart/LeftPane.preload.tsx +++ b/ts/state/smart/LeftPane.preload.tsx @@ -17,7 +17,6 @@ import { import { LeftPaneMode } from '../../types/leftPane.std.js'; import { getUsernameFromSearch } from '../../util/Username.dom.js'; import { getCountryDataForLocale } from '../../util/getCountryData.dom.js'; -import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; import { lookupConversationWithoutServiceId } from '../../util/lookupConversationWithoutServiceId.preload.js'; import { missingCaseError } from '../../util/missingCaseError.std.js'; import { isDone as isRegistrationDone } from '../../util/registration.preload.js'; @@ -314,7 +313,6 @@ export const SmartLeftPane = memo(function SmartLeftPane({ hasPendingUpdate, otherTabsUnreadStats, }: NavTabPanelProps) { - const version = window.SignalContext.getVersion(); const challengeStatus = useSelector(getChallengeStatus); const composerStep = useSelector(getComposerStep); const crashReportCount = useSelector(getCrashReportCount); @@ -474,7 +472,6 @@ export const SmartLeftPane = memo(function SmartLeftPane({ isMacOS={isMacOS} isOnline={isOnline} isNotificationProfileActive={isNotificationProfileActive} - isChatFoldersEnabled={isChatFoldersEnabled(version)} isUpdateDownloaded={isUpdateDownloaded} lookupConversationWithoutServiceId={lookupConversationWithoutServiceId} modeSpecificProps={modeSpecificProps} diff --git a/ts/state/smart/LeftPaneChatFolders.preload.tsx b/ts/state/smart/LeftPaneChatFolders.preload.tsx index f3ec83a3ce..f22343d0e1 100644 --- a/ts/state/smart/LeftPaneChatFolders.preload.tsx +++ b/ts/state/smart/LeftPaneChatFolders.preload.tsx @@ -16,7 +16,6 @@ import { useChatFolderActions } from '../ducks/chatFolders.preload.js'; import { NavSidebarWidthBreakpointContext } from '../../components/NavSidebar.dom.js'; import { useNavActions } from '../ducks/nav.std.js'; import { NavTab, SettingsPage } from '../../types/Nav.std.js'; -import { isChatFoldersEnabled } from '../../util/isChatFoldersEnabled.dom.js'; import type { ChatFolderId } from '../../types/ChatFolder.std.js'; import { getSelectedLocation } from '../selectors/nav.std.js'; import { useConversationsActions } from '../ducks/conversations.preload.js'; @@ -53,11 +52,6 @@ export const SmartLeftPaneChatFolders = memo( [changeLocation, location] ); - const version = window.SignalContext.getVersion(); - if (!isChatFoldersEnabled(version)) { - return null; - } - return ( state.donations.receipts ); - const version = useSelector(getVersion); - - const isDonationPaypalEnabled = isFeaturedEnabledSelector({ - currentVersion: version, - remoteConfig: items.remoteConfig, - betaKey: 'desktop.donationPaypal.beta', - prodKey: 'desktop.donationPaypal.prod', - }); - const { updateOrCreate } = useBadgesActions(); // Function to fetch donation badge data @@ -155,7 +138,6 @@ export const SmartPreferencesDonations = memo( showToast={showToast} contentsRef={contentsRef} initialCurrency={initialCurrency} - isDonationPaypalEnabled={isDonationPaypalEnabled} isOnline={isOnline} settingsLocation={settingsLocation} didResumeWorkflowAtStartup={donationsState.didResumeWorkflowAtStartup} diff --git a/ts/util/callQualitySurvey.dom.ts b/ts/util/callQualitySurvey.dom.ts index a214b0cba3..aead62c7ba 100644 --- a/ts/util/callQualitySurvey.dom.ts +++ b/ts/util/callQualitySurvey.dom.ts @@ -3,7 +3,6 @@ import type { CallSummary } from '@signalapp/ringrtc'; import { DAY, SECOND } from './durations/index.std.js'; -import { isFeaturedEnabledNoRedux } from './isFeatureEnabled.dom.js'; import { isMockEnvironment } from '../environment.std.js'; import { COUNTRY_CODE_FALLBACK, @@ -30,13 +29,6 @@ export function isCallFailure(callEndReasonText: string): boolean { return FAILURE_END_REASONS.has(callEndReasonText); } -export function isCallQualitySurveyEnabled(): boolean { - return isFeaturedEnabledNoRedux({ - betaKey: 'desktop.callQualitySurvey.beta', - prodKey: 'desktop.callQualitySurvey.prod', - }); -} - export function shouldShowCallQualitySurvey({ callSummary, lastSurveyTime, @@ -50,11 +42,7 @@ export function shouldShowCallQualitySurvey({ e164: string | undefined; cqsTestMode?: boolean; }): boolean { - if ( - isMockEnvironment() || - !isCallQualitySurveyEnabled() || - !callSummary.isSurveyCandidate - ) { + if (isMockEnvironment() || !callSummary.isSurveyCandidate) { return false; } diff --git a/ts/util/isChatFoldersEnabled.dom.ts b/ts/util/isChatFoldersEnabled.dom.ts deleted file mode 100644 index 92167b51b2..0000000000 --- a/ts/util/isChatFoldersEnabled.dom.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only -import * as RemoteConfig from '../RemoteConfig.dom.js'; -import { - Environment, - getEnvironment, - isMockEnvironment, -} from '../environment.std.js'; -import { isAlpha, isBeta, isProduction } from './version.std.js'; - -export function isChatFoldersEnabled(version: string): boolean { - const env = getEnvironment(); - - if ( - env === Environment.Development || - env === Environment.Test || - isMockEnvironment() - ) { - return true; - } - - if (isProduction(version)) { - return RemoteConfig.isEnabled('desktop.chatFolders.prod'); - } - if (isBeta(version)) { - return RemoteConfig.isEnabled('desktop.chatFolders.beta'); - } - if (isAlpha(version)) { - return RemoteConfig.isEnabled('desktop.chatFolders.alpha'); - } - - return false; -} diff --git a/ts/util/isPinnedMessagesEnabled.dom.ts b/ts/util/isPinnedMessagesEnabled.dom.ts deleted file mode 100644 index 8cb18405f9..0000000000 --- a/ts/util/isPinnedMessagesEnabled.dom.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -import { isFeaturedEnabledNoRedux } from './isFeatureEnabled.dom.js'; - -export function isPinnedMessagesReceiveEnabled(): boolean { - return isFeaturedEnabledNoRedux({ - betaKey: 'desktop.pinnedMessages.receive.beta', - prodKey: 'desktop.pinnedMessages.receive.prod', - }); -} - -export function isPinnedMessagesSendEnabled(): boolean { - return isFeaturedEnabledNoRedux({ - betaKey: 'desktop.pinnedMessages.send.beta', - prodKey: 'desktop.pinnedMessages.send.prod', - }); -}