Skip to content

The open alternative to Salesforce, designed for AI.

Fix broken sync-metadata (#5154)

Charles Bochet07c877941195
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.ts
index 6eb43d92586..bcde8e57275 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-sync-metadata/services/workspace-metadata-updater.service.ts
@@ -140,7 +140,7 @@ export class WorkspaceMetadataUpdaterService {
*/
const updatedFieldMetadataCollection = await this.updateEntities<
FieldMetadataEntity<'default'>
- >(manager, FieldMetadataEntity, storage.objectMetadataUpdateCollection, [
+ >(manager, FieldMetadataEntity, storage.fieldMetadataUpdateCollection, [
'objectMetadataId',
'workspaceId',
]);
@@ -241,7 +241,7 @@ export class WorkspaceMetadataUpdaterService {
manager: EntityManager,
entityClass: EntityTarget<Entity>,
updateCollection: Array<
- DeepPartial<Omit<Entity, 'fields'>> & { id: string }
+ DeepPartial<Omit<Entity, 'fields' | 'options'>> & { id: string }
>,
keysToOmit: (keyof Entity)[] = [],
): Promise<{ current: Entity; altered: Entity }[]> {
diff --git a/packages/twenty-server/src/modules/calendar/crons/jobs/google-calendar-sync.cron.job.ts b/packages/twenty-server/src/modules/calendar/crons/jobs/google-calendar-sync.cron.job.ts
index 10930e85a91..7b6af10f25a 100644
--- a/packages/twenty-server/src/modules/calendar/crons/jobs/google-calendar-sync.cron.job.ts
+++ b/packages/twenty-server/src/modules/calendar/crons/jobs/google-calendar-sync.cron.job.ts
@@ -29,7 +29,7 @@ export class GoogleCalendarSyncCronJob implements MessageQueueJob<undefined> {
const workspaceIds = (
await this.workspaceRepository.find({
where: {
- subscriptionStatus: 'active',
+ subscriptionStatus: In(['active', 'trialing', 'past_due']),
},
select: ['id'],
})
diff --git a/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-fetch-messages-from-cache.cron.job.ts b/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-fetch-messages-from-cache.cron.job.ts
index a9c75fc5e2d..b9fb6cf7d1d 100644
--- a/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-fetch-messages-from-cache.cron.job.ts
+++ b/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-fetch-messages-from-cache.cron.job.ts
@@ -30,7 +30,7 @@ export class GmailFetchMessagesFromCacheCronJob
const workspaceIds = (
await this.workspaceRepository.find({
where: {
- subscriptionStatus: 'active',
+ subscriptionStatus: In(['active', 'trialing', 'past_due']),
},
select: ['id'],
})
diff --git a/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-partial-sync.cron.job.ts b/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-partial-sync.cron.job.ts
index 2d6434d4071..54cde83f787 100644
--- a/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-partial-sync.cron.job.ts
+++ b/packages/twenty-server/src/modules/messaging/crons/jobs/gmail-partial-sync.cron.job.ts
@@ -36,7 +36,7 @@ export class GmailPartialSyncCronJob implements MessageQueueJob<undefined> {
const workspaceIds = (
await this.workspaceRepository.find({
where: {
- subscriptionStatus: 'active',
+ subscriptionStatus: In(['active', 'trialing', 'past_due']),
},
select: ['id'],
})