Skip to content

Commit

Permalink
Fix broken sync-metadata (twentyhq#5154)
Browse files Browse the repository at this point in the history
An error has been recently introduced in the sync of fieldMetadata. This
PR fixes it

Additionnally, we are enabling email for trialing and past_due
workspaces. There is an ongoing work to introduce a more robust
activationStatus on workspace.
  • Loading branch information
charlesBochet authored Apr 24, 2024
1 parent 5d2d6ba commit 07c8779
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class WorkspaceMetadataUpdaterService {
*/
const updatedFieldMetadataCollection = await this.updateEntities<
FieldMetadataEntity<'default'>
>(manager, FieldMetadataEntity, storage.objectMetadataUpdateCollection, [
>(manager, FieldMetadataEntity, storage.fieldMetadataUpdateCollection, [
'objectMetadataId',
'workspaceId',
]);
Expand Down Expand Up @@ -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 }[]> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class GmailFetchMessagesFromCacheCronJob
const workspaceIds = (
await this.workspaceRepository.find({
where: {
subscriptionStatus: 'active',
subscriptionStatus: In(['active', 'trialing', 'past_due']),
},
select: ['id'],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
})
Expand Down

0 comments on commit 07c8779

Please sign in to comment.