rename sync-completion methods to avoid confusion with stage setters (#22138)

`markAsCompletedAndMarkAsCalendarEventListFetchPending` was just
`markAsCalendarEventListFetchPending`
with a prefix, so dropping the prefix silently turned a sync-completion
into a plain stage reset

Renamed to markAsCalendarEventSyncCompleted / markAsMessageSyncCompleted
so they
no longer share a tail with the stage setters. Mirrors the existing
markAsFailed naming. No behavior change.

Sanity check: replayed the original #22015 diff through two isolated
review agents, identical prompt,
only the names differing. With the old names the reviewer explicitly
cleared the branch as safe; with
the new names it flagged the missing completion as high severity. The
rename makes the mistake visible.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22138?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
neo773
2026-06-25 14:36:38 +05:30
committed by GitHub
parent 5242ddf458
commit dc371ef6e7
7 changed files with 9 additions and 11 deletions
@@ -72,7 +72,7 @@ export class CalendarEventsImportService {
);
if (!eventIdsToFetch || eventIdsToFetch.length === 0) {
await this.calendarChannelSyncStatusService.markAsCompletedAndMarkAsCalendarEventListFetchPending(
await this.calendarChannelSyncStatusService.markAsCalendarEventSyncCompleted(
[calendarChannel.id],
workspaceId,
);
@@ -170,7 +170,7 @@ export class CalendarEventsImportService {
);
if (eventIdsToFetch.length < CALENDAR_EVENT_IMPORT_BATCH_SIZE) {
await this.calendarChannelSyncStatusService.markAsCompletedAndMarkAsCalendarEventListFetchPending(
await this.calendarChannelSyncStatusService.markAsCalendarEventSyncCompleted(
[calendarChannel.id],
workspaceId,
);
@@ -87,7 +87,7 @@ export class CalendarFetchEventsService {
workspaceId,
);
} else {
await this.calendarChannelSyncStatusService.markAsCompletedAndMarkAsCalendarEventListFetchPending(
await this.calendarChannelSyncStatusService.markAsCalendarEventSyncCompleted(
[calendarChannel.id],
workspaceId,
);
@@ -206,7 +206,7 @@ export class CalendarChannelSyncStatusService {
);
}
public async markAsCompletedAndMarkAsCalendarEventListFetchPending(
public async markAsCalendarEventSyncCompleted(
calendarChannelIds: string[],
workspaceId: string,
) {
@@ -217,7 +217,7 @@ export class MessageChannelSyncStatusService {
);
}
public async markAsCompletedAndMarkAsMessagesListFetchPending(
public async markAsMessageSyncCompleted(
messageChannelIds: string[],
workspaceId: string,
) {
@@ -78,9 +78,7 @@ describe('MessagingMessagesImportService', () => {
provide: MessageChannelSyncStatusService,
useValue: {
markAsMessagesImportOngoing: jest.fn().mockResolvedValue(undefined),
markAsCompletedAndMarkAsMessagesListFetchPending: jest
.fn()
.mockResolvedValue(undefined),
markAsMessageSyncCompleted: jest.fn().mockResolvedValue(undefined),
markAsMessagesImportPending: jest.fn().mockResolvedValue(undefined),
},
},
@@ -251,7 +251,7 @@ export class MessagingMessageListFetchService {
);
if (totalMessagesToImportCount === 0) {
await this.messageChannelSyncStatusService.markAsCompletedAndMarkAsMessagesListFetchPending(
await this.messageChannelSyncStatusService.markAsMessageSyncCompleted(
[freshMessageChannel.id],
workspaceId,
);
@@ -108,7 +108,7 @@ export class MessagingMessagesImportService {
);
if (!messageIdsToFetch?.length) {
await this.messageChannelSyncStatusService.markAsCompletedAndMarkAsMessagesListFetchPending(
await this.messageChannelSyncStatusService.markAsMessageSyncCompleted(
[messageChannel.id],
workspaceId,
);
@@ -214,7 +214,7 @@ export class MessagingMessagesImportService {
}
if (messageIdsToFetch.length < messagesGetBatchSize) {
await this.messageChannelSyncStatusService.markAsCompletedAndMarkAsMessagesListFetchPending(
await this.messageChannelSyncStatusService.markAsMessageSyncCompleted(
[messageChannel.id],
workspaceId,
);