Fix Message/Calendar channel stuck in SCHEDULED syncStage (#16326)

As per title
This commit is contained in:
Charles Bochet
2025-12-04 16:01:11 +01:00
committed by GitHub
parent ce082cd97a
commit 68a9ef57f0
7 changed files with 61 additions and 10 deletions
@@ -133,6 +133,27 @@ export class MessageChannelSyncStatusService {
});
}
public async markAsMessagesListFetchScheduled(
messageChannelIds: string[],
workspaceId: string,
) {
if (!messageChannelIds.length) {
return;
}
const messageChannelRepository =
await this.twentyORMGlobalManager.getRepositoryForWorkspace<MessageChannelWorkspaceEntity>(
workspaceId,
'messageChannel',
);
await messageChannelRepository.update(messageChannelIds, {
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_SCHEDULED,
syncStatus: MessageChannelSyncStatus.ONGOING,
syncStageStartedAt: new Date().toISOString(),
});
}
public async markAsMessagesListFetchOngoing(
messageChannelIds: string[],
workspaceId: string,
@@ -150,7 +171,6 @@ export class MessageChannelSyncStatusService {
await messageChannelRepository.update(messageChannelIds, {
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_ONGOING,
syncStatus: MessageChannelSyncStatus.ONGOING,
syncStageStartedAt: new Date().toISOString(),
});
}
@@ -182,6 +202,25 @@ export class MessageChannelSyncStatusService {
});
}
public async markAsMessagesImportScheduled(
messageChannelIds: string[],
workspaceId: string,
) {
if (!messageChannelIds.length) {
return;
}
const messageChannelRepository =
await this.twentyORMGlobalManager.getRepositoryForWorkspace<MessageChannelWorkspaceEntity>(
workspaceId,
'messageChannel',
);
await messageChannelRepository.update(messageChannelIds, {
syncStage: MessageChannelSyncStage.MESSAGES_IMPORT_SCHEDULED,
});
}
public async markAsMessagesImportOngoing(
messageChannelIds: string[],
workspaceId: string,