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:
+2
-2
@@ -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,
|
||||
);
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ export class CalendarFetchEventsService {
|
||||
workspaceId,
|
||||
);
|
||||
} else {
|
||||
await this.calendarChannelSyncStatusService.markAsCompletedAndMarkAsCalendarEventListFetchPending(
|
||||
await this.calendarChannelSyncStatusService.markAsCalendarEventSyncCompleted(
|
||||
[calendarChannel.id],
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ export class CalendarChannelSyncStatusService {
|
||||
);
|
||||
}
|
||||
|
||||
public async markAsCompletedAndMarkAsCalendarEventListFetchPending(
|
||||
public async markAsCalendarEventSyncCompleted(
|
||||
calendarChannelIds: string[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ export class MessageChannelSyncStatusService {
|
||||
);
|
||||
}
|
||||
|
||||
public async markAsCompletedAndMarkAsMessagesListFetchPending(
|
||||
public async markAsMessageSyncCompleted(
|
||||
messageChannelIds: string[],
|
||||
workspaceId: string,
|
||||
) {
|
||||
|
||||
+1
-3
@@ -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),
|
||||
},
|
||||
},
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@ export class MessagingMessageListFetchService {
|
||||
);
|
||||
|
||||
if (totalMessagesToImportCount === 0) {
|
||||
await this.messageChannelSyncStatusService.markAsCompletedAndMarkAsMessagesListFetchPending(
|
||||
await this.messageChannelSyncStatusService.markAsMessageSyncCompleted(
|
||||
[freshMessageChannel.id],
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
+2
-2
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user