The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Remove async CSV export feature flag (#28717)
Weikoa41b478568d0
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphqlindex f65aea4cfa4..f86e6821f53 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql@@ -2250,7 +2250,6 @@ enum FeatureFlagKey {IS_AI_CHAT_INBOX_ENABLEDIS_APPLICATION_MONITORING_ENABLEDIS_APP_PREFERENCES_ENABLED- IS_ASYNC_CSV_EXPORT_ENABLEDIS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLEDIS_CONFIGURABLE_SEARCH_FIELDS_ENABLEDIS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLEDdiff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.tsindex 0b95856ef4a..467f21cc2b0 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts@@ -1492,7 +1492,7 @@ export interface FeatureFlag {__typename: 'FeatureFlag'}-export type FeatureFlagKey = 'IS_AI_CHAT_INBOX_ENABLED' | 'IS_APPLICATION_MONITORING_ENABLED' | 'IS_APP_PREFERENCES_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT'+export type FeatureFlagKey = 'IS_AI_CHAT_INBOX_ENABLED' | 'IS_APPLICATION_MONITORING_ENABLED' | 'IS_APP_PREFERENCES_ENABLED' | 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT'export interface Field {applicationId: Scalars['UUID']@@ -12090,7 +12090,6 @@ export const enumFeatureFlagKey = {IS_AI_CHAT_INBOX_ENABLED: 'IS_AI_CHAT_INBOX_ENABLED' as const,IS_APPLICATION_MONITORING_ENABLED: 'IS_APPLICATION_MONITORING_ENABLED' as const,IS_APP_PREFERENCES_ENABLED: 'IS_APP_PREFERENCES_ENABLED' as const,- IS_ASYNC_CSV_EXPORT_ENABLED: 'IS_ASYNC_CSV_EXPORT_ENABLED' as const,IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED: 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' as const,IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED: 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' as const,IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED: 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' as const,diff --git a/packages/twenty-front/src/generated-admin/graphql.ts b/packages/twenty-front/src/generated-admin/graphql.tsindex 6a62fa090d5..46cd0d23e3d 100644--- a/packages/twenty-front/src/generated-admin/graphql.ts+++ b/packages/twenty-front/src/generated-admin/graphql.ts@@ -544,7 +544,6 @@ export enum FeatureFlagKey {IS_AI_CHAT_INBOX_ENABLED = 'IS_AI_CHAT_INBOX_ENABLED',IS_APPLICATION_MONITORING_ENABLED = 'IS_APPLICATION_MONITORING_ENABLED',IS_APP_PREFERENCES_ENABLED = 'IS_APP_PREFERENCES_ENABLED',- IS_ASYNC_CSV_EXPORT_ENABLED = 'IS_ASYNC_CSV_EXPORT_ENABLED',IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED = 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex 8c4be463158..58d27291057 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -2385,7 +2385,6 @@ export enum FeatureFlagKey {IS_AI_CHAT_INBOX_ENABLED = 'IS_AI_CHAT_INBOX_ENABLED',IS_APPLICATION_MONITORING_ENABLED = 'IS_APPLICATION_MONITORING_ENABLED',IS_APP_PREFERENCES_ENABLED = 'IS_APP_PREFERENCES_ENABLED',- IS_ASYNC_CSV_EXPORT_ENABLED = 'IS_ASYNC_CSV_EXPORT_ENABLED',IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED = 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',diff --git a/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordIndexCommandMenuDropdown.stories.tsx b/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordIndexCommandMenuDropdown.stories.tsxindex 31347d5e897..73af8784fbf 100644--- a/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordIndexCommandMenuDropdown.stories.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordIndexCommandMenuDropdown.stories.tsx@@ -23,7 +23,6 @@ import {CommandMenuItemAvailabilityType,type CommandMenuItemFieldsFragment,EngineComponentKey,- FeatureFlagKey,} from '~/generated-metadata/graphql';import { ContextStoreDecorator } from '~/testing/decorators/ContextStoreDecorator';import { MemoryRouterDecorator } from '~/testing/decorators/MemoryRouterDecorator';@@ -177,12 +176,7 @@ const meta: Meta<typeof RecordIndexCommandMenuDropdown> = {...mockCurrentWorkspace.installedApplications,THIRD_PARTY_APPLICATION,],- featureFlags: [- {- key: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: true,- },- ],+ featureFlags: [],});},};diff --git a/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordShowSidePanelCommandMenuDropdown.stories.tsx b/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordShowSidePanelCommandMenuDropdown.stories.tsxindex fe98d12851a..ccefa0704e1 100644--- a/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordShowSidePanelCommandMenuDropdown.stories.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/components/__stories__/RecordShowSidePanelCommandMenuDropdown.stories.tsx@@ -15,7 +15,6 @@ import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';import { type Meta, type StoryObj } from '@storybook/react-vite';import { expect, userEvent, waitFor, within } from 'storybook/test';import { ComponentDecorator } from 'twenty-ui/testing';-import { FeatureFlagKey } from '~/generated-metadata/graphql';import { ContextStoreDecorator } from '~/testing/decorators/ContextStoreDecorator';import { MemoryRouterDecorator } from '~/testing/decorators/MemoryRouterDecorator';import { ObjectMetadataItemsDecorator } from '~/testing/decorators/ObjectMetadataItemsDecorator';@@ -75,12 +74,7 @@ const meta: Meta<typeof RecordPageSidePanelCommandMenuDropdown> = {beforeEach: () => {jotaiStore.set(currentWorkspaceState.atom, {...mockCurrentWorkspace,- featureFlags: [- {- key: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: true,- },- ],+ featureFlags: [],});},};diff --git a/packages/twenty-front/src/modules/command-menu-item/display/hooks/useCommandMenuItemDisplay.ts b/packages/twenty-front/src/modules/command-menu-item/display/hooks/useCommandMenuItemDisplay.tsindex 2167cda4d3a..aea2e714054 100644--- a/packages/twenty-front/src/modules/command-menu-item/display/hooks/useCommandMenuItemDisplay.ts+++ b/packages/twenty-front/src/modules/command-menu-item/display/hooks/useCommandMenuItemDisplay.ts@@ -3,15 +3,10 @@ import { interpolateCommandMenuItemFields } from '@/command-menu-item/display/utimport { useCommandMenuItemClick } from '@/command-menu-item/hooks/useCommandMenuItemClick';import { type CommandMenuItemDefinition } from '@/command-menu-item/types/CommandMenuItemDefinition';import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants/CommandMenuDefaultIcon';-import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useContext } from 'react';import { useIcons } from 'twenty-ui/icon';-import { FeatureFlagKey } from '~/generated-metadata/graphql';export const useCommandMenuItemDisplay = (item: CommandMenuItemDefinition) => {- const isAsyncCsvExportEnabled = useIsFeatureEnabled(- FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- );const { commandMenuContextApi } = useContext(CommandMenuContext);const { getIcon } = useIcons();@@ -31,7 +26,7 @@ export const useCommandMenuItemDisplay = (item: CommandMenuItemDefinition) => {shortLabel,handleClick,disabled,- progress: isAsyncCsvExportEnabled ? progress : undefined,- isLoading: isAsyncCsvExportEnabled && showDisabledLoader,+ progress,+ isLoading: showDisabledLoader,};};diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/ExportRecordsCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/ExportRecordsCommand.tsxindex 2ce6af9695e..c668aac5403 100644--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/ExportRecordsCommand.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/ExportRecordsCommand.tsx@@ -1,7 +1,5 @@import { RecordExportConnectionEffect } from '@/record-export/components/RecordExportConnectionEffect';import { useRecordIndexAsyncExportRecords } from '@/object-record/record-index/export/hooks/useRecordIndexAsyncExportRecords';-import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';-import { FeatureFlagKey } from '~/generated-metadata/graphql';import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';import { useHeadlessCommandContextApi } from '@/command-menu-item/engine-command/hooks/useHeadlessCommandContextApi';import { CommandComponentInstanceContext } from '@/command-menu-item/engine-command/states/contexts/CommandComponentInstanceContext';@@ -12,43 +10,11 @@ import { useExportSingleRecord } from '@/object-record/record-show/hooks/useExpoimport { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceIdOrThrow';import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';-import { useCallback, useEffect, useState } from 'react';+import { useCallback, useState } from 'react';import { isDefined } from 'twenty-shared/utils';import { doNotTranslate } from 'twenty-shared/i18n';const ExportIndexRecordsContent = ({- objectMetadataItem,- recordIndexId,- setCommandMenuItemProgress,-}: {- objectMetadataItem: EnrichedObjectMetadataItem;- recordIndexId: string;- setCommandMenuItemProgress: (value: number | undefined) => void;-}) => {- const { download, progress } = useRecordIndexExportRecords({- delayMs: 100,- objectMetadataItem,- recordIndexId,- filename: `${objectMetadataItem.nameSingular}.csv`,- });-- useEffect(() => {- if (- isDefined(progress.totalRecordCount) &&- isDefined(progress.processedRecordCount) &&- progress.totalRecordCount > 0- ) {- const percentage = Math.round(- (progress.processedRecordCount / progress.totalRecordCount) * 100,- );- setCommandMenuItemProgress(percentage);- }- }, [progress, setCommandMenuItemProgress]);-- return <HeadlessEngineCommandWrapperEffect execute={download} />;-};--const ExportAsyncIndexRecordsContent = ({objectMetadataItem,recordIndexId,onProgress,@@ -103,9 +69,6 @@ const ExportShowRecordContent = ({};export const ExportRecordsCommand = () => {- const isAsyncCsvExportEnabled = useIsFeatureEnabled(- FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- );const { objectMetadataItem, recordIndexId, selectedRecords } =useHeadlessCommandContextApi();@@ -148,19 +111,11 @@ export const ExportRecordsCommand = () => {<ViewComponentInstanceContext.Providervalue={{ instanceId: recordIndexId }}>- {isAsyncCsvExportEnabled ? (- <ExportAsyncIndexRecordsContent- objectMetadataItem={objectMetadataItem}- recordIndexId={recordIndexId}- onProgress={setCommandMenuItemProgress}- />- ) : (- <ExportIndexRecordsContent- objectMetadataItem={objectMetadataItem}- recordIndexId={recordIndexId}- setCommandMenuItemProgress={setCommandMenuItemProgress}- />- )}+ <ExportIndexRecordsContent+ objectMetadataItem={objectMetadataItem}+ recordIndexId={recordIndexId}+ onProgress={setCommandMenuItemProgress}+ /></ViewComponentInstanceContext.Provider>);};diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/__tests__/ExportRecordsCommand.test.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/__tests__/ExportRecordsCommand.test.tsxindex 2f7118885c7..4759c386918 100644--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/__tests__/ExportRecordsCommand.test.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/record/components/__tests__/ExportRecordsCommand.test.tsx@@ -4,7 +4,6 @@ import { CommandComponentInstanceContext } from '@/command-menu-item/engine-commimport { render, waitFor } from '@testing-library/react';import { type ReactNode } from 'react';import { isDefined } from 'twenty-shared/utils';-import { FeatureFlagKey } from '~/generated-metadata/graphql';import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';import { mockCurrentWorkspace } from '~/testing/mock-data/users';import { getMockObjectMetadataItemOrThrow } from '~/testing/utils/getMockObjectMetadataItemOrThrow';@@ -66,25 +65,14 @@ jest.mock('@/object-record/record-show/hooks/useExportSingleRecord', () => ({}));const renderExport = ({- isAsyncCsvExportEnabled,isStrictMode = false,-}: {- isAsyncCsvExportEnabled?: boolean;- isStrictMode?: boolean;-}) => {+}: { isStrictMode?: boolean } = {}) => {const Wrapper = getJestMetadataAndApolloMocksWrapper({apolloMocks: [],onInitializeJotaiStore: (store) => {store.set(currentWorkspaceState.atom, {...mockCurrentWorkspace,- featureFlags: !isDefined(isAsyncCsvExportEnabled)- ? []- : [- {- key: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: isAsyncCsvExportEnabled,- },- ],+ featureFlags: [],});},});@@ -109,39 +97,26 @@ beforeEach(() => {mockHasMoreRecords = false;});-it.each([undefined, false, true])(- 'exports a single batch locally when the workspace flag is %s',- async (isAsyncCsvExportEnabled) => {- renderExport({ isAsyncCsvExportEnabled });- await waitFor(() => expect(mockIndexDownload).toHaveBeenCalledTimes(1));- expect(mockAsyncDownload).not.toHaveBeenCalled();- expect(mockSingleRecordDownload).not.toHaveBeenCalled();- },-);+it('exports a complete first batch locally without a feature flag', async () => {+ renderExport();+ await waitFor(() => expect(mockIndexDownload).toHaveBeenCalledTimes(1));+ expect(mockAsyncDownload).not.toHaveBeenCalled();+ expect(mockSingleRecordDownload).not.toHaveBeenCalled();+});-it.each([undefined, false, true])(- 'uses the async fallback for additional pages only when the workspace flag is enabled (%s)',- async (isAsyncCsvExportEnabled) => {- mockHasMoreRecords = true;- renderExport({ isAsyncCsvExportEnabled });- await waitFor(() => expect(mockIndexDownload).toHaveBeenCalledTimes(1));- if (isAsyncCsvExportEnabled) {- await waitFor(() => expect(mockAsyncDownload).toHaveBeenCalledTimes(1));- } else {- expect(mockAsyncDownload).not.toHaveBeenCalled();- }- expect(mockSingleRecordDownload).not.toHaveBeenCalled();- },-);+it('uses the async fallback for additional pages without a feature flag', async () => {+ mockHasMoreRecords = true;+ renderExport();+ await waitFor(() => expect(mockIndexDownload).toHaveBeenCalledTimes(1));+ await waitFor(() => expect(mockAsyncDownload).toHaveBeenCalledTimes(1));+ expect(mockSingleRecordDownload).not.toHaveBeenCalled();+});it.each([false, true])('keeps index export active through StrictMode remounts, hasMoreRecords=%s',async (hasMoreRecords) => {mockHasMoreRecords = hasMoreRecords;- const { unmount } = renderExport({- isAsyncCsvExportEnabled: true,- isStrictMode: true,- });+ const { unmount } = renderExport({ isStrictMode: true });await waitFor(() =>expect(mockCompletedIndexDownload).toHaveBeenCalledTimes(1),@@ -157,15 +132,12 @@ it.each([false, true])(},);-it.each([false, true])(- 'keeps single-record export when the workspace flag is %s',- async (isAsyncCsvExportEnabled) => {- mockRecordIndexId = undefined;- renderExport({ isAsyncCsvExportEnabled });- await waitFor(() =>- expect(mockSingleRecordDownload).toHaveBeenCalledTimes(1),- );- expect(mockAsyncDownload).not.toHaveBeenCalled();- expect(mockIndexDownload).not.toHaveBeenCalled();- },-);+it('keeps single-record exports local', async () => {+ mockRecordIndexId = undefined;+ renderExport();+ await waitFor(() =>+ expect(mockSingleRecordDownload).toHaveBeenCalledTimes(1),+ );+ expect(mockAsyncDownload).not.toHaveBeenCalled();+ expect(mockIndexDownload).not.toHaveBeenCalled();+});diff --git a/packages/twenty-front/src/modules/command-menu-item/hooks/__tests__/useCommandMenuItemClick.test.tsx b/packages/twenty-front/src/modules/command-menu-item/hooks/__tests__/useCommandMenuItemClick.test.tsxindex 16e56bad488..c78001a52f9 100644--- a/packages/twenty-front/src/modules/command-menu-item/hooks/__tests__/useCommandMenuItemClick.test.tsx+++ b/packages/twenty-front/src/modules/command-menu-item/hooks/__tests__/useCommandMenuItemClick.test.tsx@@ -44,10 +44,6 @@ jest.mock(}),);-jest.mock('@/workspace/hooks/useIsFeatureEnabled', () => ({- useIsFeatureEnabled: () => false,-}));-jest.mock('@/command-menu-item/engine-command/hooks/useMountCommand', () => ({useMountCommand: () => mockMountCommand,}));diff --git a/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts b/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.tsindex bfb407c1f67..618a2355ca0 100644--- a/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts+++ b/packages/twenty-front/src/modules/command-menu-item/hooks/useCommandMenuItemClick.ts@@ -1,4 +1,3 @@-import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { type CommandMenuItemDefinition } from '@/command-menu-item/types/CommandMenuItemDefinition';import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext';import { useMountCommand } from '@/command-menu-item/engine-command/hooks/useMountCommand';@@ -20,7 +19,6 @@ import { ENGINE_COMPONENT_KEY_COMPONENT_MAP } from '@/command-menu-item/engine-cimport { ExportRecordsCommand } from '@/command-menu-item/engine-command/record/components/ExportRecordsCommand';import { isDefined } from 'twenty-shared/utils';import { type IconComponent } from 'twenty-ui/icon';-import { FeatureFlagKey } from '~/generated-metadata/graphql';export const useCommandMenuItemClick = ({item,@@ -31,9 +29,6 @@ export const useCommandMenuItemClick = ({Icon: IconComponent;label: string;}) => {- const isAsyncCsvExportEnabled = useIsFeatureEnabled(- FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- );const { commandMenuContextApi } = useContext(CommandMenuContext);const mountCommand = useMountCommand();const store = useStore();@@ -93,7 +88,7 @@ export const useCommandMenuItemClick = ({const isExport =isValidElement(engineComponent) &&engineComponent.type === ExportRecordsCommand;- if (!isExport || !isAsyncCsvExportEnabled) {+ if (!isExport) {closeCommandMenu();}diff --git a/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts b/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.tsindex 181919083d8..4c1cbc7228f 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts+++ b/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts@@ -8,10 +8,6 @@ export const SETTINGS_ADMIN_FEATURE_FLAG_METADATA: Record<FeatureFlagKey,{ label: MessageDescriptor; description: MessageDescriptor }> = {- [FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED]: {- label: msg`Async CSV export`,- description: msg`Generate CSV exports in the background with progress and automatic downloads.`,- },[FeatureFlagKey.IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED]: {label: msg`Configurable search fields`,description: msg`Choose which fields are used when searching for records.`,diff --git a/packages/twenty-front/src/modules/workspace/utils/__tests__/getWorkspaceFeatureFlagsMap.test.ts b/packages/twenty-front/src/modules/workspace/utils/__tests__/getWorkspaceFeatureFlagsMap.test.tsindex c201f8d0b7f..1fe93aa1ba9 100644--- a/packages/twenty-front/src/modules/workspace/utils/__tests__/getWorkspaceFeatureFlagsMap.test.ts+++ b/packages/twenty-front/src/modules/workspace/utils/__tests__/getWorkspaceFeatureFlagsMap.test.ts@@ -12,11 +12,14 @@ describe('getWorkspaceFeatureFlagsMap', () => {expect(getWorkspaceFeatureFlagsMap([{ key: FeatureFlagKey.IS_AI_CHAT_INBOX_ENABLED, value: true },- { key: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED, value: false },+ {+ key: FeatureFlagKey.IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED,+ value: false,+ },]),).toEqual({IS_AI_CHAT_INBOX_ENABLED: true,- IS_ASYNC_CSV_EXPORT_ENABLED: false,+ IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED: false,});});});diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/validates/feature-flag.validate.spec.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/validates/feature-flag.validate.spec.tsindex a3ab82beb1f..057fde6014e 100644--- a/packages/twenty-server/src/engine/core-modules/feature-flag/validates/feature-flag.validate.spec.ts+++ b/packages/twenty-server/src/engine/core-modules/feature-flag/validates/feature-flag.validate.spec.ts@@ -8,7 +8,7 @@ describe('featureFlagValidator', () => {it('should not throw error if featureFlagKey is valid', () => {expect(() =>featureFlagValidator.assertIsFeatureFlagKey(- 'IS_ASYNC_CSV_EXPORT_ENABLED',+ 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',new UnknownException('Error', 'Error', {userFriendlyMessage: msg`Error`,}),diff --git a/packages/twenty-server/src/engine/core-modules/record-export/record-export.module.ts b/packages/twenty-server/src/engine/core-modules/record-export/record-export.module.tsindex 8662863c64f..2446e270608 100644--- a/packages/twenty-server/src/engine/core-modules/record-export/record-export.module.ts+++ b/packages/twenty-server/src/engine/core-modules/record-export/record-export.module.ts@@ -3,7 +3,6 @@ import { TypeOrmModule } from '@nestjs/typeorm';import { CoreEntityCacheModule } from 'src/engine/core-entity-cache/core-entity-cache.module';import { CoreCommonApiModule } from 'src/engine/api/common/core-common-api.module';-import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';import { JwtModule } from 'src/engine/core-modules/jwt/jwt.module';import { GenerateRecordExportJob } from 'src/engine/core-modules/record-export/jobs/generate-record-export.job';@@ -23,7 +22,6 @@ import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cacheUserSessionModule,CoreCommonApiModule,CoreEntityCacheModule,- FeatureFlagModule,JwtModule,UserWorkspaceModule,PermissionsModule,diff --git a/packages/twenty-server/src/engine/core-modules/record-export/record-export.resolver.ts b/packages/twenty-server/src/engine/core-modules/record-export/record-export.resolver.tsindex 81c3b3e550b..cd0423d2f46 100644--- a/packages/twenty-server/src/engine/core-modules/record-export/record-export.resolver.ts+++ b/packages/twenty-server/src/engine/core-modules/record-export/record-export.resolver.ts@@ -3,14 +3,11 @@ import { Args, Context, Subscription } from '@nestjs/graphql';import { type Request } from 'express';import { PermissionFlagType } from 'twenty-shared/constants';-import { FeatureFlagKey } from 'twenty-shared/types';import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';import { getWorkspaceAuthContext } from 'src/engine/core-modules/auth/storage/workspace-auth-context.storage';-import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';-import { ForbiddenError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';import { CreateRecordExportInput } from 'src/engine/core-modules/record-export/dtos/create-record-export.input';import { RecordExportDTO } from 'src/engine/core-modules/record-export/dtos/record-export.dto';import { RecordExportExceptionFilter } from 'src/engine/core-modules/record-export/record-export-exception-filter';@@ -41,7 +38,6 @@ import { AuthPrincipalGuard } from 'src/engine/guards/auth-principal.guard';export class RecordExportResolver {constructor(private readonly recordExportWorkspaceService: RecordExportWorkspaceService,- private readonly featureFlagService: FeatureFlagService,) {}@Subscription(() => RecordExportDTO, {@@ -52,16 +48,6 @@ export class RecordExportResolver {@Context() context: { req: Request },): Promise<AsyncIterableIterator<RecordExportDTO>> {const authContext = getWorkspaceAuthContext();- if (- !(await this.featureFlagService.isFeatureEnabled(- FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- authContext.workspace.id,- ))- ) {- throw new ForbiddenError(- 'Asynchronous CSV export is not enabled for this workspace',- );- }return this.recordExportWorkspaceService.stream({parameters: input,authContext,diff --git a/packages/twenty-server/test/integration/graphql/suites/settings-permissions/workspace.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/settings-permissions/workspace.integration-spec.tsindex 0346daec127..9e4b4ed302d 100644--- a/packages/twenty-server/test/integration/graphql/suites/settings-permissions/workspace.integration-spec.ts+++ b/packages/twenty-server/test/integration/graphql/suites/settings-permissions/workspace.integration-spec.ts@@ -634,7 +634,8 @@ describe('workspace permissions', () => {`,variables: {input: {- publicFeatureFlag: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,+ publicFeatureFlag:+ FeatureFlagKey.IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED,value: true,},},diff --git a/packages/twenty-server/test/integration/record-export/record-export.integration-spec.ts b/packages/twenty-server/test/integration/record-export/record-export.integration-spec.tsindex 90e476c19a7..930ed5e1683 100644--- a/packages/twenty-server/test/integration/record-export/record-export.integration-spec.ts+++ b/packages/twenty-server/test/integration/record-export/record-export.integration-spec.ts@@ -25,8 +25,6 @@ import { hashUserSessionToken } from 'src/engine/core-modules/user-session/utilsimport { isUserSessionToken } from 'src/engine/core-modules/user-session/utils/is-user-session-token.util';import { AuthProviderEnum } from 'src/engine/core-modules/workspace/types/workspace.type';import { upsertRowLevelPermissionPredicates } from 'test/integration/metadata/suites/row-level-permission-predicate/utils/upsert-row-level-permission-predicates.util';-import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';-import { type FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';import { createClient } from 'graphql-sse';import { setTimeout } from 'node:timers/promises';import { Readable } from 'node:stream';@@ -43,11 +41,7 @@ import { findOneRoleByLabel } from 'test/integration/metadata/suites/role/utils/import { updateOneRole } from 'test/integration/metadata/suites/role/utils/update-one-role.util';import { updateWorkspaceMemberRole } from 'test/integration/metadata/suites/role/utils/update-workspace-member-role.util';import { getAppProviderByClassName } from 'test/integration/utils/get-app-provider-by-class-name.util';-import {- FeatureFlagKey,- FileFolder,- OrderByDirection,-} from 'twenty-shared/types';+import { FileFolder, OrderByDirection } from 'twenty-shared/types';import { isDefined } from 'twenty-shared/utils';import { v4 } from 'uuid';@@ -101,7 +95,6 @@ describe('record export lifecycle (integration)', () => {let reader: RecordExportQueryService;let originalRoleId: string;let roleId: string;- let wasAsyncCsvExportEnabled: boolean;const connections: ReturnType<typeof createClient>[] = [];const exportIds = new Set<string>();const downloadTokens = new Map<string, string>();@@ -249,17 +242,6 @@ describe('record export lifecycle (integration)', () => {};beforeAll(async () => {- const featureFlagService =- getAppProviderByClassName<FeatureFlagService>('FeatureFlagService');- wasAsyncCsvExportEnabled = await featureFlagService.isFeatureEnabled(- FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- SEED_APPLE_WORKSPACE_ID,- );- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: true,- expectToFail: false,- });exports = getAppProviderByClassName('RecordExportWorkspaceService');cache = global.app.get<CacheStorageService>(CacheStorageNamespace.EngineRecordExport,@@ -366,11 +348,6 @@ describe('record export lifecycle (integration)', () => {expectToFail: false,});}- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: wasAsyncCsvExportEnabled,- expectToFail: false,- });if (isDefined(originalRoleId)) {await updateWorkspaceMemberRole({input: {@@ -398,28 +375,6 @@ describe('record export lifecycle (integration)', () => {}}, 60_000);- it('rejects new async exports when disabled and still downloads an already prepared file', async () => {- const ready = await exportToCompletion();- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: false,- expectToFail: false,- });- try {- const { events } = subscribe();- await expect(nextExport(events)).rejects.toThrow(- 'Asynchronous CSV export is not enabled for this workspace',- );- await download(ready).expect(200);- } finally {- await updateFeatureFlag({- featureFlag: FeatureFlagKey.IS_ASYNC_CSV_EXPORT_ENABLED,- value: true,- expectToFail: false,- });- }- });-it('exports every selected page in column and record order, then deletes the download', async () => {const recordExport = await exportToCompletion({...input,diff --git a/packages/twenty-shared/src/types/FeatureFlagKey.ts b/packages/twenty-shared/src/types/FeatureFlagKey.tsindex 5a02fda6319..de2ed276382 100644--- a/packages/twenty-shared/src/types/FeatureFlagKey.ts+++ b/packages/twenty-shared/src/types/FeatureFlagKey.ts@@ -1,5 +1,4 @@export enum FeatureFlagKey {- IS_ASYNC_CSV_EXPORT_ENABLED = 'IS_ASYNC_CSV_EXPORT_ENABLED',IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED = 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',IS_MESSAGE_CAMPAIGN_ENABLED = 'IS_MESSAGE_CAMPAIGN_ENABLED',IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT',