From e751592fe24071e7c714cf18e9ca17a538976fbb Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:52:00 -0600 Subject: [PATCH] Remove poll feature flag gates Co-authored-by: yash-signal --- images/icons/v3/attach/attach.svg | 1 - stylesheets/components/CompositionArea.scss | 40 ------------- ts/RemoteConfig.dom.ts | 6 -- ts/background.preload.ts | 26 +-------- ts/components/CompositionArea.dom.tsx | 25 ++------ ts/components/conversation/Message.dom.tsx | 3 +- ts/messages/handleDataMessage.preload.ts | 7 +-- ts/types/Polls.dom.ts | 65 --------------------- ts/util/enqueuePollCreateForSend.dom.ts | 5 -- 9 files changed, 8 insertions(+), 170 deletions(-) delete mode 100644 images/icons/v3/attach/attach.svg diff --git a/images/icons/v3/attach/attach.svg b/images/icons/v3/attach/attach.svg deleted file mode 100644 index 5230a89484..0000000000 --- a/images/icons/v3/attach/attach.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/stylesheets/components/CompositionArea.scss b/stylesheets/components/CompositionArea.scss index 911968e281..b54c5316ee 100644 --- a/stylesheets/components/CompositionArea.scss +++ b/stylesheets/components/CompositionArea.scss @@ -249,44 +249,4 @@ } } } - - &__attach-file { - width: 32px; - height: 32px; - border-radius: 4px; - padding: 0; - border: none; - background: transparent; - display: flex; - align-items: center; - justify-content: center; - - @include mixins.keyboard-mode { - &:focus { - outline: 2px solid variables.$color-ultramarine; - } - } - - outline: none; - - &:before { - content: ''; - display: inline-block; - width: 20px; - height: 20px; - - @include mixins.light-theme { - @include mixins.color-svg( - '../images/icons/v3/attach/attach.svg', - variables.$color-gray-75 - ); - } - @include mixins.dark-theme { - @include mixins.color-svg( - '../images/icons/v3/attach/attach.svg', - variables.$color-gray-15 - ); - } - } - } } diff --git a/ts/RemoteConfig.dom.ts b/ts/RemoteConfig.dom.ts index 7fc52f25c9..22a8bc92bf 100644 --- a/ts/RemoteConfig.dom.ts +++ b/ts/RemoteConfig.dom.ts @@ -71,12 +71,6 @@ const ScalarKeys = [ 'desktop.retryRespondMaxAge', 'desktop.senderKey.retry', 'desktop.senderKeyMaxAge', - 'desktop.pollReceive.alpha', - 'desktop.pollReceive.beta1', - 'desktop.pollReceive.prod1', - 'desktop.pollSend.alpha', - 'desktop.pollSend.beta', - 'desktop.pollSend.prod', 'desktop.recentGifs.allowLegacyTenorCdnUrls', 'global.attachments.maxBytes', 'global.attachments.maxReceiveBytes', diff --git a/ts/background.preload.ts b/ts/background.preload.ts index cf0a59e7f9..386d4ac4af 100644 --- a/ts/background.preload.ts +++ b/ts/background.preload.ts @@ -67,11 +67,7 @@ import { RoutineProfileRefresher } from './routineProfileRefresh.preload.js'; import { isOlderThan } from './util/timestamp.std.js'; import { isValidReactionEmoji } from './reactions/isValidReactionEmoji.std.js'; import { safeParsePartial } from './util/schemas.std.js'; -import { - PollVoteSchema, - PollTerminateSchema, - isPollReceiveEnabled, -} from './types/Polls.dom.js'; +import { PollVoteSchema, PollTerminateSchema } from './types/Polls.dom.js'; import type { ConversationModel } from './models/conversations.preload.js'; import { isIncoming } from './messages/helpers.std.js'; import { getAuthor } from './messages/sources.preload.js'; @@ -2519,11 +2515,6 @@ export async function startApp(): Promise { } if (data.message.pollVote) { - if (!isPollReceiveEnabled()) { - log.warn('Dropping PollVote because the flag is disabled'); - confirm(); - return; - } const { pollVote, timestamp } = data.message; const parsed = safeParsePartial(PollVoteSchema, pollVote); @@ -2561,11 +2552,6 @@ export async function startApp(): Promise { } if (data.message.pollTerminate) { - if (!isPollReceiveEnabled()) { - log.warn('Dropping PollTerminate because the flag is disabled'); - confirm(); - return; - } const { pollTerminate, timestamp, expireTimer } = data.message; const parsedTerm = safeParsePartial(PollTerminateSchema, pollTerminate); @@ -3029,11 +3015,6 @@ export async function startApp(): Promise { } if (data.message.pollVote) { - if (!isPollReceiveEnabled()) { - log.warn('Dropping PollVote because the flag is disabled'); - confirm(); - return; - } const { pollVote, timestamp } = data.message; const parsed = safeParsePartial(PollVoteSchema, pollVote); @@ -3074,11 +3055,6 @@ export async function startApp(): Promise { } if (data.message.pollTerminate) { - if (!isPollReceiveEnabled()) { - log.warn('Dropping PollTerminate because the flag is disabled'); - confirm(); - return; - } const { pollTerminate, timestamp, expireTimer } = data.message; const parsedTerm = safeParsePartial(PollTerminateSchema, pollTerminate); diff --git a/ts/components/CompositionArea.dom.tsx b/ts/components/CompositionArea.dom.tsx index 0effc83a72..f9dc0d340e 100644 --- a/ts/components/CompositionArea.dom.tsx +++ b/ts/components/CompositionArea.dom.tsx @@ -87,7 +87,7 @@ import { FunPickerButton } from './fun/FunButton.dom.js'; import { AxoDropdownMenu } from '../axo/AxoDropdownMenu.dom.js'; import { AxoIconButton } from '../axo/AxoIconButton.dom.js'; import { tw } from '../axo/tw.dom.js'; -import { isPollSendEnabled, type PollCreateType } from '../types/Polls.dom.js'; +import type { PollCreateType } from '../types/Polls.dom.js'; import { PollCreateModal } from './PollCreateModal.dom.js'; import { useDocumentKeyDown } from '../hooks/useDocumentKeyDown.dom.js'; @@ -823,11 +823,8 @@ export const CompositionArea = memo(function CompositionArea({ 'flex size-8 shrink-0 items-center justify-center' ); - let attButton; - if (draftEditMessage || linkPreviewResult || isRecording) { - attButton = undefined; - } else if (isPollSendEnabled()) { - attButton = ( + const composerAddMenuButton = + draftEditMessage || linkPreviewResult || isRecording ? null : (
@@ -860,18 +857,6 @@ export const CompositionArea = memo(function CompositionArea({
); - } else { - attButton = ( -
-
- ); - } const sendButtonFragment = !draftEditMessage ? ( <> @@ -1304,7 +1289,7 @@ export const CompositionArea = memo(function CompositionArea({ <> {!dirty ? micButtonFragment : null} {editMessageFragment} - {attButton} + {composerAddMenuButton} )}
@@ -1316,7 +1301,7 @@ export const CompositionArea = memo(function CompositionArea({ )} > {leftHandSideButtonsFragment} - {attButton} + {composerAddMenuButton} {!dirty ? micButtonFragment : null} {editMessageFragment} {dirty || !shouldShowMicrophone ? sendButtonFragment : null} diff --git a/ts/components/conversation/Message.dom.tsx b/ts/components/conversation/Message.dom.tsx index 6e1d88d635..f4681c8499 100644 --- a/ts/components/conversation/Message.dom.tsx +++ b/ts/components/conversation/Message.dom.tsx @@ -98,7 +98,6 @@ import { isPaymentNotificationEvent } from '../../types/Payment.std.js'; import type { AnyPaymentEvent } from '../../types/Payment.std.js'; import { getPaymentEventDescription } from '../../messages/payments.std.js'; import { PanelType } from '../../types/Panels.std.js'; -import { isPollReceiveEnabled } from '../../types/Polls.dom.js'; import type { PollWithResolvedVotersType } from '../../state/selectors/message.preload.js'; import { PollMessageContents } from './poll-message/PollMessageContents.dom.js'; import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser.dom.js'; @@ -2062,7 +2061,7 @@ export class Message extends React.PureComponent { public renderPoll(): React.JSX.Element | null { const { poll, direction, i18n, id, endPoll, canEndPoll } = this.props; - if (!poll || !isPollReceiveEnabled()) { + if (!poll) { return null; } return ( diff --git a/ts/messages/handleDataMessage.preload.ts b/ts/messages/handleDataMessage.preload.ts index 1075fc48cc..328f4586cf 100644 --- a/ts/messages/handleDataMessage.preload.ts +++ b/ts/messages/handleDataMessage.preload.ts @@ -68,7 +68,7 @@ import { import { saveAndNotify } from './saveAndNotify.preload.js'; import { MessageModel } from '../models/messages.preload.js'; import { safeParsePartial } from '../util/schemas.std.js'; -import { PollCreateSchema, isPollReceiveEnabled } from '../types/Polls.dom.js'; +import { PollCreateSchema } from '../types/Polls.dom.js'; import type { SentEventData } from '../textsecure/messageReceiverEvents.std.js'; import type { @@ -472,11 +472,6 @@ export async function handleDataMessage( let validatedPollCreate: z.infer | undefined; if (initialMessage.pollCreate) { - if (!isPollReceiveEnabled()) { - log.warn(`${idLog}: Dropping PollCreate because flag is not enabled`); - confirm(); - return; - } const result = safeParsePartial( PollCreateSchema, initialMessage.pollCreate diff --git a/ts/types/Polls.dom.ts b/ts/types/Polls.dom.ts index 285e4894d2..d66e0ba454 100644 --- a/ts/types/Polls.dom.ts +++ b/ts/types/Polls.dom.ts @@ -3,13 +3,6 @@ import { z } from 'zod'; import { hasAtMostGraphemes } from '../util/grapheme.std.js'; -import { - Environment, - getEnvironment, - isMockEnvironment, -} from '../environment.std.js'; -import * as RemoteConfig from '../RemoteConfig.dom.js'; -import { isAlpha, isBeta, isProduction } from '../util/version.std.js'; import { isFeaturedEnabledNoRedux } from '../util/isFeatureEnabled.dom.js'; import type { SendStateByConversationId } from '../messages/MessageSendState.std.js'; import { aciSchema } from './ServiceId.std.js'; @@ -117,64 +110,6 @@ export type PollCreateType = Pick< 'question' | 'options' | 'allowMultiple' >; -export function isPollReceiveEnabled(): boolean { - const env = getEnvironment(); - - if ( - env === Environment.Development || - env === Environment.Test || - env === Environment.Staging || - isMockEnvironment() - ) { - return true; - } - - const version = window.getVersion?.(); - - if (version != null) { - if (isProduction(version)) { - return RemoteConfig.isEnabled('desktop.pollReceive.prod1'); - } - if (isBeta(version)) { - return RemoteConfig.isEnabled('desktop.pollReceive.beta1'); - } - if (isAlpha(version)) { - return RemoteConfig.isEnabled('desktop.pollReceive.alpha'); - } - } - - return false; -} - -export function isPollSendEnabled(): boolean { - const env = getEnvironment(); - - if ( - env === Environment.Development || - env === Environment.Test || - env === Environment.Staging || - isMockEnvironment() - ) { - return true; - } - - const version = window.getVersion?.(); - - if (version != null) { - if (isProduction(version)) { - return RemoteConfig.isEnabled('desktop.pollSend.prod'); - } - if (isBeta(version)) { - return RemoteConfig.isEnabled('desktop.pollSend.beta'); - } - if (isAlpha(version)) { - return RemoteConfig.isEnabled('desktop.pollSend.alpha'); - } - } - - return false; -} - export function isPollSend1to1Enabled(): boolean { return isFeaturedEnabledNoRedux({ betaKey: 'desktop.pollSend1to1.beta', diff --git a/ts/util/enqueuePollCreateForSend.dom.ts b/ts/util/enqueuePollCreateForSend.dom.ts index e6d64972c2..ab448fd990 100644 --- a/ts/util/enqueuePollCreateForSend.dom.ts +++ b/ts/util/enqueuePollCreateForSend.dom.ts @@ -5,7 +5,6 @@ import type { ConversationModel } from '../models/conversations.preload.js'; import { isDirectConversation } from './whatTypeOfConversation.dom.js'; import { isPollSend1to1Enabled, - isPollSendEnabled, type PollCreateType, } from '../types/Polls.dom.js'; @@ -13,10 +12,6 @@ export async function enqueuePollCreateForSend( conversation: ConversationModel, poll: PollCreateType ): Promise { - if (!isPollSendEnabled()) { - throw new Error('enqueuePollCreateForSend: poll sending is not enabled'); - } - if ( isDirectConversation(conversation.attributes) && !isPollSend1to1Enabled()