Fix reconnect google account bug (#5905)

Update syncStage to FULL_MESSAGE_LIST_FETCH_PENDING when reconnecting
the account to trigger a full sync on the next cron iteration.
This commit is contained in:
bosiraphael 2024-06-19 16:00:39 +02:00 committed by GitHub
parent d6fcb9cae8
commit 016132ecf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,7 +57,11 @@ export class MessageChannelRepository {
this.workspaceDataSourceService.getSchemaName(workspaceId);
await this.workspaceDataSourceService.executeRawQuery(
`UPDATE ${dataSourceSchema}."messageChannel" SET "syncStatus" = NULL, "syncCursor" = '', "syncStageStartedAt" = NULL
`UPDATE ${dataSourceSchema}."messageChannel"
SET "syncStatus" = NULL,
"syncStage" = '${MessageChannelSyncStage.FULL_MESSAGE_LIST_FETCH_PENDING}',
"syncCursor" = '',
"syncStageStartedAt" = NULL
WHERE "connectedAccountId" = $1`,
[connectedAccountId],
workspaceId,