The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Remove old Calendar and Messaging partial/full sync stages (#15380)
Charles Bochet6cf5bd2ed417
diff --git a/packages/twenty-front/src/modules/accounts/types/CalendarChannel.ts b/packages/twenty-front/src/modules/accounts/types/CalendarChannel.tsindex c0cff271db2..5805bc731a2 100644--- a/packages/twenty-front/src/modules/accounts/types/CalendarChannel.ts+++ b/packages/twenty-front/src/modules/accounts/types/CalendarChannel.ts@@ -10,8 +10,6 @@ export enum CalendarChannelSyncStatus {export enum CalendarChannelSyncStage {PENDING_CONFIGURATION = 'PENDING_CONFIGURATION',- FULL_CALENDAR_EVENT_LIST_FETCH_PENDING = 'FULL_CALENDAR_EVENT_LIST_FETCH_PENDING', // WILL BE DEPRECATED- PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING = 'PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING', // DEPRECATEDCALENDAR_EVENT_LIST_FETCH_PENDING = 'CALENDAR_EVENT_LIST_FETCH_PENDING',CALENDAR_EVENT_LIST_FETCH_SCHEDULED = 'CALENDAR_EVENT_LIST_FETCH_SCHEDULED',CALENDAR_EVENT_LIST_FETCH_ONGOING = 'CALENDAR_EVENT_LIST_FETCH_ONGOING',diff --git a/packages/twenty-front/src/modules/accounts/types/MessageChannel.ts b/packages/twenty-front/src/modules/accounts/types/MessageChannel.tsindex 92fd9a44bd0..c963e10f4c7 100644--- a/packages/twenty-front/src/modules/accounts/types/MessageChannel.ts+++ b/packages/twenty-front/src/modules/accounts/types/MessageChannel.ts@@ -24,8 +24,6 @@ export enum MessageChannelSyncStatus {export enum MessageChannelSyncStage {PENDING_CONFIGURATION = 'PENDING_CONFIGURATION',- FULL_MESSAGE_LIST_FETCH_PENDING = 'FULL_MESSAGE_LIST_FETCH_PENDING', // WILL BE DEPRECATED- PARTIAL_MESSAGE_LIST_FETCH_PENDING = 'PARTIAL_MESSAGE_LIST_FETCH_PENDING', // DEPRECATEDMESSAGE_LIST_FETCH_PENDING = 'MESSAGE_LIST_FETCH_PENDING',MESSAGE_LIST_FETCH_SCHEDULED = 'MESSAGE_LIST_FETCH_SCHEDULED',MESSAGE_LIST_FETCH_ONGOING = 'MESSAGE_LIST_FETCH_ONGOING',diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsxindex 897c84fcbf3..d2e9ccafced 100644--- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsCalendars.stories.tsx@@ -95,7 +95,7 @@ export const TwoConnectedAccounts: Story = {connectedAccountId:'20202020-954c-4d76-9a87-e5f072d4b7ef',contactAutoCreationPolicy: 'SENT',- syncStage: 'FULL_CALENDAR_EVENT_LIST_FETCH_PENDING',+ syncStage: 'CALENDAR_EVENT_LIST_FETCH_PENDING',type: 'email',isContactAutoCreationEnabled: true,syncCursor: '1562764',diff --git a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsxindex 57273f5930e..63c528a9d14 100644--- a/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx+++ b/packages/twenty-front/src/pages/settings/accounts/__stories__/SettingsAccountsEmails.stories.tsx@@ -96,7 +96,7 @@ export const TwoConnectedAccounts: Story = {connectedAccountId:'20202020-954c-4d76-9a87-e5f072d4b7ef',contactAutoCreationPolicy: 'SENT',- syncStage: 'FULL_MESSAGE_LIST_FETCH_PENDING',+ syncStage: 'MESSAGE_LIST_FETCH_PENDING',type: 'email',isContactAutoCreationEnabled: true,syncCursor: '1562764',@@ -122,7 +122,7 @@ export const TwoConnectedAccounts: Story = {connectedAccountId:'20202020-954c-4d76-9a87-e5f072d4b7ef',contactAutoCreationPolicy: 'SENT',- syncStage: 'FULL_MESSAGE_LIST_FETCH_PENDING',+ syncStage: 'MESSAGE_LIST_FETCH_PENDING',type: 'email',isContactAutoCreationEnabled: true,syncCursor: '1562764',diff --git a/packages/twenty-front/src/testing/mock-data/generated/mock-metadata-query-result.ts b/packages/twenty-front/src/testing/mock-data/generated/mock-metadata-query-result.tsindex 58971b671ca..196b1998122 100644--- a/packages/twenty-front/src/testing/mock-data/generated/mock-metadata-query-result.ts+++ b/packages/twenty-front/src/testing/mock-data/generated/mock-metadata-query-result.ts@@ -17300,13 +17300,13 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery ="isUnique": false,"createdAt": "2025-06-09T18:53:47.000Z","updatedAt": "2025-06-09T18:53:47.000Z",- "defaultValue": "'FULL_CALENDAR_EVENT_LIST_FETCH_PENDING'",+ "defaultValue": "'CALENDAR_EVENT_LIST_FETCH_PENDING'","options": [{"id": "a63c16e1-fe1e-40ff-9380-118f16b30a16","color": "blue","label": "Full calendar event list fetch pending",- "value": "FULL_CALENDAR_EVENT_LIST_FETCH_PENDING",+ "value": "CALENDAR_EVENT_LIST_FETCH_PENDING","position": 0},{@@ -18145,22 +18145,15 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery ="isUnique": false,"createdAt": "2025-06-09T18:53:47.000Z","updatedAt": "2025-06-09T18:53:47.000Z",- "defaultValue": "'FULL_MESSAGE_LIST_FETCH_PENDING'",+ "defaultValue": "'MESSAGE_LIST_FETCH_PENDING'","options": [{"id": "60f0c071-4375-4e1c-ac0f-3b6c64cb35b3","color": "blue",- "label": "Full messages list fetch pending",- "value": "FULL_MESSAGE_LIST_FETCH_PENDING",+ "label": "Messages list fetch pending",+ "value": "MESSAGE_LIST_FETCH_PENDING","position": 0},- {- "id": "0728c8f0-8c9f-4a01-9ccc-d3ff68e64d12",- "color": "blue",- "label": "Partial messages list fetch pending",- "value": "PARTIAL_MESSAGE_LIST_FETCH_PENDING",- "position": 1- },{"id": "ec623d96-5b17-4a67-8206-d475a76b2f31","color": "orange",diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/reset-calendar-channel.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/reset-calendar-channel.service.tsindex 03950de33b3..f350cd85844 100644--- a/packages/twenty-server/src/engine/core-modules/auth/services/reset-calendar-channel.service.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/services/reset-calendar-channel.service.ts@@ -35,8 +35,7 @@ export class ResetCalendarChannelService {connectedAccountId,},{- syncStage:- CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING,+ syncStage: CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING,syncStatus: null,syncCursor: '',syncStageStartedAt: null,diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/reset-message-channel.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/reset-message-channel.service.tsindex b08bc9f0e9f..5ba9bcf91f1 100644--- a/packages/twenty-server/src/engine/core-modules/auth/services/reset-message-channel.service.ts+++ b/packages/twenty-server/src/engine/core-modules/auth/services/reset-message-channel.service.ts@@ -34,7 +34,7 @@ export class ResetMessageChannelService {connectedAccountId,},{- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,syncStatus: MessageChannelSyncStatus.ONGOING,syncCursor: '',syncStageStartedAt: null,diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant.tsindex 4f0ca4195a7..1d1e1dd0b26 100644--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant.ts+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant.ts@@ -59,7 +59,7 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [handle: '[email protected]',isSyncEnabled: true,visibility: MessageChannelVisibility.SHARE_EVERYTHING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,},{id: MESSAGE_CHANNEL_DATA_SEED_IDS.JONY,@@ -72,7 +72,7 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [handle: '[email protected]',isSyncEnabled: true,visibility: MessageChannelVisibility.SHARE_EVERYTHING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,},{id: MESSAGE_CHANNEL_DATA_SEED_IDS.PHIL,@@ -85,7 +85,7 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [handle: '[email protected]',isSyncEnabled: true,visibility: MessageChannelVisibility.SHARE_EVERYTHING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,},{id: MESSAGE_CHANNEL_DATA_SEED_IDS.SUPPORT,@@ -98,7 +98,7 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [handle: '[email protected]',isSyncEnabled: true,visibility: MessageChannelVisibility.SHARE_EVERYTHING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,},{id: MESSAGE_CHANNEL_DATA_SEED_IDS.SALES,@@ -111,6 +111,6 @@ export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [handle: '[email protected]',isSyncEnabled: true,visibility: MessageChannelVisibility.SHARE_EVERYTHING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,},];diff --git a/packages/twenty-server/src/modules/calendar/blocklist-manager/jobs/blocklist-reimport-calendar-events.job.ts b/packages/twenty-server/src/modules/calendar/blocklist-manager/jobs/blocklist-reimport-calendar-events.job.tsindex 256eeb6373f..e6bcd8a16cb 100644--- a/packages/twenty-server/src/modules/calendar/blocklist-manager/jobs/blocklist-reimport-calendar-events.job.ts+++ b/packages/twenty-server/src/modules/calendar/blocklist-manager/jobs/blocklist-reimport-calendar-events.job.ts@@ -49,7 +49,7 @@ export class BlocklistReimportCalendarEventsJob {accountOwnerId: workspaceMemberId,},syncStage: Not(- CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING,+ CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING,),},});diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/commands/calendar-relaunch-failed-calendar-channels.command.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/commands/calendar-relaunch-failed-calendar-channels.command.tsindex 58a1b777fbe..09eef091b50 100644--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/commands/calendar-relaunch-failed-calendar-channels.command.ts+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/commands/calendar-relaunch-failed-calendar-channels.command.ts@@ -58,7 +58,7 @@ export class CalendarRelaunchFailedCalendarChannelsCommand extends ActiveOrSuspefailedCalendarChannels.map(({ id }) => id),{syncStage:- CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING,+ CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING,syncStatus: CalendarChannelSyncStatus.ACTIVE,},);diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/crons/jobs/calendar-event-list-fetch.cron.job.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/crons/jobs/calendar-event-list-fetch.cron.job.tsindex e445d779128..d52310f45c6 100644--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/crons/jobs/calendar-event-list-fetch.cron.job.ts+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/crons/jobs/calendar-event-list-fetch.cron.job.ts@@ -51,7 +51,7 @@ export class CalendarEventListFetchCronJob {const schemaName = getWorkspaceSchemaName(activeWorkspace.id);const calendarChannels = await this.coreDataSource.query(- `SELECT * FROM ${schemaName}."calendarChannel" WHERE "isSyncEnabled" = true AND "syncStage" IN ('${CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING}', '${CalendarChannelSyncStage.PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING}')`,+ `SELECT * FROM ${schemaName}."calendarChannel" WHERE "isSyncEnabled" = true AND "syncStage" IN ('${CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING}')`,);for (const calendarChannel of calendarChannels) {diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/jobs/calendar-event-list-fetch.job.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/jobs/calendar-event-list-fetch.job.tsindex 20595bf7da1..8e061d82650 100644--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/jobs/calendar-event-list-fetch.job.ts+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/jobs/calendar-event-list-fetch.job.ts@@ -58,8 +58,7 @@ export class CalendarEventListFetchJob {switch (calendarChannel.syncStage) {case CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_SCHEDULED:- case CalendarChannelSyncStage.PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING: // DEPRECATED- case CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING: // WILL BE DEPRECATED+ case CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING:await this.calendarFetchEventsService.fetchCalendarEvents(calendarChannel,calendarChannel.connectedAccount,diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.tsindex 9eda6f77bbd..39f941dd0fd 100644--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-event-import-exception-handler.service.ts@@ -18,8 +18,7 @@ import {import { CalendarChannelSyncStatusService } from 'src/modules/calendar/common/services/calendar-channel-sync-status.service';import { type CalendarChannelWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';export enum CalendarEventImportSyncStep {- FULL_CALENDAR_EVENT_LIST_FETCH = 'FULL_CALENDAR_EVENT_LIST_FETCH',- PARTIAL_CALENDAR_EVENT_LIST_FETCH = 'PARTIAL_CALENDAR_EVENT_LIST_FETCH',+ CALENDAR_EVENT_LIST_FETCH = 'CALENDAR_EVENT_LIST_FETCH',CALENDAR_EVENTS_IMPORT = 'CALENDAR_EVENTS_IMPORT',}@@ -129,13 +128,7 @@ export class CalendarEventImportErrorHandlerService {);switch (syncStep) {- case CalendarEventImportSyncStep.FULL_CALENDAR_EVENT_LIST_FETCH:- await this.calendarChannelSyncStatusService.scheduleCalendarEventListFetch(- [calendarChannel.id],- );- break;-- case CalendarEventImportSyncStep.PARTIAL_CALENDAR_EVENT_LIST_FETCH:+ case CalendarEventImportSyncStep.CALENDAR_EVENT_LIST_FETCH:await this.calendarChannelSyncStatusService.scheduleCalendarEventListFetch([calendarChannel.id],);@@ -199,9 +192,7 @@ export class CalendarEventImportErrorHandlerService {calendarChannel: Pick<CalendarChannelWorkspaceEntity, 'id'>,workspaceId: string,): Promise<void> {- if (- syncStep === CalendarEventImportSyncStep.FULL_CALENDAR_EVENT_LIST_FETCH- ) {+ if (syncStep === CalendarEventImportSyncStep.CALENDAR_EVENT_LIST_FETCH) {return;}diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.tsindex 75b2ef49215..2bb64f24f9f 100644--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.ts+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.ts@@ -16,10 +16,7 @@ import {import { CalendarEventsImportService } from 'src/modules/calendar/calendar-event-import-manager/services/calendar-events-import.service';import { CalendarGetCalendarEventsService } from 'src/modules/calendar/calendar-event-import-manager/services/calendar-get-events.service';import { CalendarChannelSyncStatusService } from 'src/modules/calendar/common/services/calendar-channel-sync-status.service';-import {- CalendarChannelSyncStage,- type CalendarChannelWorkspaceEntity,-} from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';+import { type CalendarChannelWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';import { type ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';@Injectable()@@ -41,12 +38,6 @@ export class CalendarFetchEventsService {connectedAccount: ConnectedAccountWorkspaceEntity,workspaceId: string,): Promise<void> {- const syncStep =- calendarChannel.syncStage ===- CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING- ? CalendarEventImportSyncStep.FULL_CALENDAR_EVENT_LIST_FETCH- : CalendarEventImportSyncStep.PARTIAL_CALENDAR_EVENT_LIST_FETCH;-await this.calendarChannelSyncStatusService.markAsCalendarEventListFetchOngoing([calendarChannel.id],);@@ -142,7 +133,7 @@ export class CalendarFetchEventsService {this.logger.error(error);await this.calendarEventImportErrorHandlerService.handleDriverException(error,- syncStep,+ CalendarEventImportSyncStep.CALENDAR_EVENT_LIST_FETCH,calendarChannel,workspaceId,);diff --git a/packages/twenty-server/src/modules/calendar/common/services/calendar-channel-sync-status.service.ts b/packages/twenty-server/src/modules/calendar/common/services/calendar-channel-sync-status.service.tsindex 02d1fd77a56..503dbbc5492 100644--- a/packages/twenty-server/src/modules/calendar/common/services/calendar-channel-sync-status.service.ts+++ b/packages/twenty-server/src/modules/calendar/common/services/calendar-channel-sync-status.service.ts@@ -38,8 +38,7 @@ export class CalendarChannelSyncStatusService {);await calendarChannelRepository.update(calendarChannelIds, {- syncStage:- CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING,+ syncStage: CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING,});}@@ -149,8 +148,7 @@ export class CalendarChannelSyncStatusService {);await calendarChannelRepository.update(calendarChannelIds, {- syncStage:- CalendarChannelSyncStage.PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING,+ syncStage: CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING,syncStatus: CalendarChannelSyncStatus.ACTIVE,throttleFailureCount: 0,syncStageStartedAt: null,diff --git a/packages/twenty-server/src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity.ts b/packages/twenty-server/src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity.tsindex f19fa449146..00f3d429b27 100644--- a/packages/twenty-server/src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity.ts+++ b/packages/twenty-server/src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity.ts@@ -36,8 +36,6 @@ export enum CalendarChannelSyncStatus {export enum CalendarChannelSyncStage {PENDING_CONFIGURATION = 'PENDING_CONFIGURATION',- FULL_CALENDAR_EVENT_LIST_FETCH_PENDING = 'FULL_CALENDAR_EVENT_LIST_FETCH_PENDING', // WILL BE DEPRECATED- PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING = 'PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING', // DEPRECATEDCALENDAR_EVENT_LIST_FETCH_PENDING = 'CALENDAR_EVENT_LIST_FETCH_PENDING',CALENDAR_EVENT_LIST_FETCH_SCHEDULED = 'CALENDAR_EVENT_LIST_FETCH_SCHEDULED',CALENDAR_EVENT_LIST_FETCH_ONGOING = 'CALENDAR_EVENT_LIST_FETCH_ONGOING',@@ -182,19 +180,6 @@ export class CalendarChannelWorkspaceEntity extends BaseWorkspaceEntity {position: 6,color: 'red',},- {- value: CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING,- label: 'Full calendar event list fetch pending',- position: 7,- color: 'blue',- },- {- value:- CalendarChannelSyncStage.PARTIAL_CALENDAR_EVENT_LIST_FETCH_PENDING,- label: 'Partial calendar event list fetch pending',- position: 8,- color: 'blue',- },{value: CalendarChannelSyncStage.PENDING_CONFIGURATION,label: 'Pending configuration',diff --git a/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.spec.ts b/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.spec.tsindex 2c08301b5f1..757d629a747 100644--- a/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.spec.ts+++ b/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.spec.ts@@ -124,7 +124,7 @@ describe('ImapSmtpCalDavAPIService', () => {handle: '[email protected]',isSyncEnabled: true,syncStatus: MessageChannelSyncStatus.ONGOING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,syncCursor: '',syncStageStartedAt: null,};@@ -154,7 +154,7 @@ describe('ImapSmtpCalDavAPIService', () => {handle: '[email protected]',isSyncEnabled: true,syncStatus: MessageChannelSyncStatus.ONGOING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,syncCursor: '',syncStageStartedAt: null,},@@ -254,7 +254,7 @@ describe('ImapSmtpCalDavAPIService', () => {handle: '[email protected]',isSyncEnabled: true,syncStatus: MessageChannelSyncStatus.ONGOING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,};mockMessageChannelRepository.save.mockResolvedValue(@@ -363,7 +363,7 @@ describe('ImapSmtpCalDavAPIService', () => {handle: '[email protected]',isSyncEnabled: true,syncStatus: MessageChannelSyncStatus.ONGOING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,};mockMessageChannelRepository.save.mockResolvedValue(@@ -422,7 +422,7 @@ describe('ImapSmtpCalDavAPIService', () => {handle: '[email protected]',isSyncEnabled: true,syncStatus: MessageChannelSyncStatus.ONGOING,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,};const expectedCalendarChannel = {diff --git a/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.ts b/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.tsindex 31f952bc626..491e4801e9d 100644--- a/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.ts+++ b/packages/twenty-server/src/modules/connected-account/services/imap-smtp-caldav-apis.service.ts@@ -172,7 +172,7 @@ export class ImapSmtpCalDavAPIService {? MessageChannelSyncStatus.ONGOING: MessageChannelSyncStatus.NOT_SYNCED,syncStage: shouldEnableSync- ? MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING+ ? MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING: undefined,syncCursor: '',syncStageStartedAt: null,@@ -202,8 +202,7 @@ export class ImapSmtpCalDavAPIService {handle: input.handle,isSyncEnabled: shouldEnableSync,syncStatus: CalendarChannelSyncStatus.ONGOING,- syncStage:- CalendarChannelSyncStage.FULL_CALENDAR_EVENT_LIST_FETCH_PENDING,+ syncStage: CalendarChannelSyncStage.CALENDAR_EVENT_LIST_FETCH_PENDING,syncCursor: '',syncStageStartedAt: null,},diff --git a/packages/twenty-server/src/modules/messaging/blocklist-manager/jobs/messaging-blocklist-reimport-messages.job.ts b/packages/twenty-server/src/modules/messaging/blocklist-manager/jobs/messaging-blocklist-reimport-messages.job.tsindex b51e1be42e9..4ae2f314f3f 100644--- a/packages/twenty-server/src/modules/messaging/blocklist-manager/jobs/messaging-blocklist-reimport-messages.job.ts+++ b/packages/twenty-server/src/modules/messaging/blocklist-manager/jobs/messaging-blocklist-reimport-messages.job.ts@@ -48,9 +48,7 @@ export class BlocklistReimportMessagesJob {connectedAccount: {accountOwnerId: workspaceMemberId,},- syncStage: Not(- MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,- ),+ syncStage: Not(MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING),},});diff --git a/packages/twenty-server/src/modules/messaging/common/services/message-channel-sync-status.service.ts b/packages/twenty-server/src/modules/messaging/common/services/message-channel-sync-status.service.tsindex 8e0bbe7d379..51bc3ae0924 100644--- a/packages/twenty-server/src/modules/messaging/common/services/message-channel-sync-status.service.ts+++ b/packages/twenty-server/src/modules/messaging/common/services/message-channel-sync-status.service.ts@@ -38,7 +38,7 @@ export class MessageChannelSyncStatusService {);await messageChannelRepository.update(messageChannelIds, {- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,});}@@ -131,7 +131,7 @@ export class MessageChannelSyncStatusService {await messageChannelRepository.update(messageChannelIds, {syncStatus: MessageChannelSyncStatus.ACTIVE,- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,throttleFailureCount: 0,syncStageStartedAt: null,syncedAt: new Date().toISOString(),diff --git a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.tsindex 17a9ba0517b..648148600c4 100644--- a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts+++ b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-channel.workspace-entity.ts@@ -32,8 +32,6 @@ export enum MessageChannelSyncStatus {export enum MessageChannelSyncStage {PENDING_CONFIGURATION = 'PENDING_CONFIGURATION',- FULL_MESSAGE_LIST_FETCH_PENDING = 'FULL_MESSAGE_LIST_FETCH_PENDING', // WILL BE DEPRECATED- PARTIAL_MESSAGE_LIST_FETCH_PENDING = 'PARTIAL_MESSAGE_LIST_FETCH_PENDING', // DEPRECATEDMESSAGE_LIST_FETCH_PENDING = 'MESSAGE_LIST_FETCH_PENDING',MESSAGE_LIST_FETCH_SCHEDULED = 'MESSAGE_LIST_FETCH_SCHEDULED',MESSAGE_LIST_FETCH_ONGOING = 'MESSAGE_LIST_FETCH_ONGOING',@@ -419,22 +417,10 @@ export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {position: 6,color: 'red',},- {- value: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING, // WILL BE DEPRECATED- label: 'Full messages list fetch pending',- position: 7,- color: 'blue',- },- {- value: MessageChannelSyncStage.PARTIAL_MESSAGE_LIST_FETCH_PENDING, // DEPRECATED- label: 'Partial messages list fetch pending',- position: 8,- color: 'blue',- },{value: MessageChannelSyncStage.PENDING_CONFIGURATION,label: 'Pending configuration',- position: 9,+ position: 7,color: 'gray',},],diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/commands/messaging-relaunch-failed-message-channels.command.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/commands/messaging-relaunch-failed-message-channels.command.tsindex 4316b9e66c4..420bcc29324 100644--- a/packages/twenty-server/src/modules/messaging/message-import-manager/commands/messaging-relaunch-failed-message-channels.command.ts+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/commands/messaging-relaunch-failed-message-channels.command.ts@@ -57,7 +57,7 @@ export class MessagingRelaunchFailedMessageChannelsCommand extends ActiveOrSuspeawait messageChannelRepository.update(failedMessageChannels.map(({ id }) => id),{- syncStage: MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING,+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,syncStatus: MessageChannelSyncStatus.ACTIVE,},);diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/crons/jobs/messaging-message-list-fetch.cron.job.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/crons/jobs/messaging-message-list-fetch.cron.job.tsindex a22bcce6b07..4063e0d270c 100644--- a/packages/twenty-server/src/modules/messaging/message-import-manager/crons/jobs/messaging-message-list-fetch.cron.job.ts+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/crons/jobs/messaging-message-list-fetch.cron.job.ts@@ -48,9 +48,8 @@ export class MessagingMessageListFetchCronJob {try {const schemaName = getWorkspaceSchemaName(activeWorkspace.id);- // TODO: deprecate looking for FULL_MESSAGE_LIST_FETCH_PENDING as we introduce MESSAGE_LIST_FETCH_PENDINGconst messageChannels = await this.coreDataSource.query(- `SELECT * FROM ${schemaName}."messageChannel" WHERE "isSyncEnabled" = true AND "syncStage" IN ('${MessageChannelSyncStage.PARTIAL_MESSAGE_LIST_FETCH_PENDING}', '${MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING}')`,+ `SELECT * FROM ${schemaName}."messageChannel" WHERE "isSyncEnabled" = true AND "syncStage" IN ('${MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING}')`,);for (const messageChannel of messageChannels) {diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/jobs/messaging-message-list-fetch.job.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/jobs/messaging-message-list-fetch.job.tsindex a6a30236bca..bc1d4fe8d49 100644--- a/packages/twenty-server/src/modules/messaging/message-import-manager/jobs/messaging-message-list-fetch.job.ts+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/jobs/messaging-message-list-fetch.job.ts@@ -77,10 +77,8 @@ export class MessagingMessageListFetchJob {switch (messageChannel.syncStage) {case MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING:- case MessageChannelSyncStage.PARTIAL_MESSAGE_LIST_FETCH_PENDING: // DEPRECATED- case MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING: // WILL BE DEPRECATEDawait this.messagingMonitoringService.track({- eventName: 'full_message_list_fetch.started',+ eventName: 'message_list_fetch.started',workspaceId,connectedAccountId: messageChannel.connectedAccount.id,messageChannelId: messageChannel.id,@@ -92,7 +90,7 @@ export class MessagingMessageListFetchJob {);await this.messagingMonitoringService.track({- eventName: 'full_message_list_fetch.completed',+ eventName: 'message_list_fetch.completed',workspaceId,connectedAccountId: messageChannel.connectedAccount.id,messageChannelId: messageChannel.id,diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-messages-import.service.spec.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-messages-import.service.spec.tsindex 91ca2024583..f973b916cf4 100644--- a/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-messages-import.service.spec.ts+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/services/messaging-messages-import.service.spec.ts@@ -194,7 +194,7 @@ describe('MessagingMessagesImportService', () => {it('should fails if SyncStage is not MESSAGES_IMPORT_PENDING', async () => {mockMessageChannel.syncStage =- MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING;+ MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING;expect(service.processMessageBatchImport(