From 3a5545c7537aace006d8b31fde36ffba3f4e818a Mon Sep 17 00:00:00 2001 From: neo773 <62795688+neo773@users.noreply.github.com> Date: Thu, 9 Jul 2026 03:05:35 +0530 Subject: [PATCH] chore: remove IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED flag (#22680) Messaging/calendar webhook subscriptions are now always on; drop the feature flag gate and its enum/public-flag registration. Review in cubic --- .../src/metadata/generated/schema.graphql | 1 - .../src/metadata/generated/schema.ts | 3 +-- packages/twenty-front/src/generated-admin/graphql.ts | 1 - .../twenty-front/src/generated-metadata/graphql.ts | 1 - .../constants/public-feature-flag.const.ts | 8 -------- .../entity-manager/workspace-entity-manager.spec.ts | 1 - .../calendar-webhook-subscription.service.ts | 12 ------------ .../messaging-webhook-subscription.service.ts | 12 ------------ packages/twenty-shared/src/types/FeatureFlagKey.ts | 1 - 9 files changed, 1 insertion(+), 39 deletions(-) diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql index 663ea9497b..278981d323 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql +++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql @@ -1757,7 +1757,6 @@ enum FeatureFlagKey { IS_REST_METADATA_API_NEW_FORMAT_DIRECT IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED IS_SETTINGS_DISCOVERY_HERO_ENABLED - IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED IS_WORKFLOW_VERSION_IN_CORE_ENABLED } diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts index 6493f2045a..aa6f2ef676 100644 --- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts +++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts @@ -1396,7 +1396,7 @@ export interface FeatureFlag { __typename: 'FeatureFlag' } -export type FeatureFlagKey = 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_EMAIL_GROUP_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' | 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' | 'IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED' | 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' +export type FeatureFlagKey = 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_EMAIL_GROUP_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' | 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' | 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' | 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' export interface WorkspaceUrls { customUrl?: Scalars['String'] @@ -9249,7 +9249,6 @@ export const enumFeatureFlagKey = { IS_REST_METADATA_API_NEW_FORMAT_DIRECT: 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT' as const, IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED: 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED' as const, IS_SETTINGS_DISCOVERY_HERO_ENABLED: 'IS_SETTINGS_DISCOVERY_HERO_ENABLED' as const, - IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED: 'IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED' as const, IS_WORKFLOW_VERSION_IN_CORE_ENABLED: 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED' as const } diff --git a/packages/twenty-front/src/generated-admin/graphql.ts b/packages/twenty-front/src/generated-admin/graphql.ts index 22e89e7e20..504f58ee17 100644 --- a/packages/twenty-front/src/generated-admin/graphql.ts +++ b/packages/twenty-front/src/generated-admin/graphql.ts @@ -317,7 +317,6 @@ export enum FeatureFlagKey { IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED', IS_JUNCTION_RELATIONS_ENABLED = 'IS_JUNCTION_RELATIONS_ENABLED', IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED', - IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED = 'IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED', IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT', IS_SETTINGS_DISCOVERY_HERO_ENABLED = 'IS_SETTINGS_DISCOVERY_HERO_ENABLED', IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED', diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index 2407feff8c..a986475d53 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -1757,7 +1757,6 @@ export enum FeatureFlagKey { IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED', IS_JUNCTION_RELATIONS_ENABLED = 'IS_JUNCTION_RELATIONS_ENABLED', IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED', - IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED = 'IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED', IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT', IS_SETTINGS_DISCOVERY_HERO_ENABLED = 'IS_SETTINGS_DISCOVERY_HERO_ENABLED', IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED', diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts index a6497aac15..72a1f4380f 100644 --- a/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts +++ b/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts @@ -28,14 +28,6 @@ export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [ 'Show the per-page hero illustration + video walkthrough modal on settings pages', }, }, - { - key: FeatureFlagKey.IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED, - metadata: { - label: 'Messaging & Calendar Webhooks', - description: - 'Sync Gmail, Google Calendar, and Microsoft 365 mail/calendar via provider push notifications instead of cron polling', - }, - }, ...(process.env.CLOUDFLARE_API_KEY ? [ // { diff --git a/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts b/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts index b74c437f3a..e4b4ec5db9 100644 --- a/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts +++ b/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts @@ -241,7 +241,6 @@ describe('WorkspaceEntityManager', () => { IS_REST_METADATA_API_NEW_FORMAT_DIRECT: false, IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED: false, IS_SETTINGS_DISCOVERY_HERO_ENABLED: false, - IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED: false, IS_WORKFLOW_VERSION_IN_CORE_ENABLED: false, }, userWorkspaceRoleMap: {}, diff --git a/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/calendar-webhook-subscription.service.ts b/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/calendar-webhook-subscription.service.ts index b273b91c84..b90135c697 100644 --- a/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/calendar-webhook-subscription.service.ts +++ b/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/calendar-webhook-subscription.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { - FeatureFlagKey, WebhookSubscriptionChannelType, WebhookSubscriptionStatus, } from 'twenty-shared/types'; @@ -11,7 +10,6 @@ import { Repository } from 'typeorm'; import { v4 } from 'uuid'; import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service'; -import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service'; import { CalendarChannelEntity } from 'src/engine/metadata-modules/calendar-channel/entities/calendar-channel.entity'; import { ConnectedAccountEntity } from 'src/engine/metadata-modules/connected-account/entities/connected-account.entity'; import { WebhookSubscriptionDriverFactory } from 'src/modules/connected-account/webhook-subscription-manager/services/webhook-subscription-driver-factory.service'; @@ -25,7 +23,6 @@ export class CalendarWebhookSubscriptionService { @InjectRepository(CalendarChannelEntity) private readonly calendarChannelRepository: Repository, private readonly webhookSubscriptionDriverFactory: WebhookSubscriptionDriverFactory, - private readonly featureFlagService: FeatureFlagService, private readonly exceptionHandlerService: ExceptionHandlerService, ) {} @@ -33,15 +30,6 @@ export class CalendarWebhookSubscriptionService { calendarChannelId: string, workspaceId: string, ): Promise { - const isWebhookEnabled = await this.featureFlagService.isFeatureEnabled( - FeatureFlagKey.IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED, - workspaceId, - ); - - if (!isWebhookEnabled) { - return; - } - const calendarChannel = await this.calendarChannelRepository.findOne({ where: { id: calendarChannelId, workspaceId }, relations: ['connectedAccount'], diff --git a/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/messaging-webhook-subscription.service.ts b/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/messaging-webhook-subscription.service.ts index bb1b9e418b..4e3d1e858f 100644 --- a/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/messaging-webhook-subscription.service.ts +++ b/packages/twenty-server/src/modules/connected-account/webhook-subscription-manager/services/messaging-webhook-subscription.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { - FeatureFlagKey, WebhookSubscriptionChannelType, WebhookSubscriptionStatus, } from 'twenty-shared/types'; @@ -11,7 +10,6 @@ import { Repository } from 'typeorm'; import { v4 } from 'uuid'; import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service'; -import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service'; import { ConnectedAccountEntity } from 'src/engine/metadata-modules/connected-account/entities/connected-account.entity'; import { MessageChannelEntity } from 'src/engine/metadata-modules/message-channel/entities/message-channel.entity'; import { WebhookSubscriptionDriverFactory } from 'src/modules/connected-account/webhook-subscription-manager/services/webhook-subscription-driver-factory.service'; @@ -25,7 +23,6 @@ export class MessagingWebhookSubscriptionService { @InjectRepository(MessageChannelEntity) private readonly messageChannelRepository: Repository, private readonly webhookSubscriptionDriverFactory: WebhookSubscriptionDriverFactory, - private readonly featureFlagService: FeatureFlagService, private readonly exceptionHandlerService: ExceptionHandlerService, ) {} @@ -33,15 +30,6 @@ export class MessagingWebhookSubscriptionService { messageChannelId: string, workspaceId: string, ): Promise { - const isWebhookEnabled = await this.featureFlagService.isFeatureEnabled( - FeatureFlagKey.IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED, - workspaceId, - ); - - if (!isWebhookEnabled) { - return; - } - const messageChannel = await this.messageChannelRepository.findOne({ where: { id: messageChannelId, workspaceId }, relations: ['connectedAccount'], diff --git a/packages/twenty-shared/src/types/FeatureFlagKey.ts b/packages/twenty-shared/src/types/FeatureFlagKey.ts index e87a2a3272..7f1a0d66bd 100644 --- a/packages/twenty-shared/src/types/FeatureFlagKey.ts +++ b/packages/twenty-shared/src/types/FeatureFlagKey.ts @@ -6,6 +6,5 @@ export enum FeatureFlagKey { IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT', IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED = 'IS_LOGIC_FUNCTION_PREBUILT_MODE_ENABLED', IS_SETTINGS_DISCOVERY_HERO_ENABLED = 'IS_SETTINGS_DISCOVERY_HERO_ENABLED', - IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED = 'IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED', IS_WORKFLOW_VERSION_IN_CORE_ENABLED = 'IS_WORKFLOW_VERSION_IN_CORE_ENABLED', }