From 8182b2a07d14c355fcbe6249d6e7f441281a42e9 Mon Sep 17 00:00:00 2001 From: Etienne <45695613+etiennejouan@users.noreply.github.com> Date: Thu, 2 Jul 2026 10:24:35 +0200 Subject: [PATCH] fix(billing) - invalidate activationStatus after billing event (#22414) Issue with workspaces still blocked after being re-activated Review in cubic --- .../services/billing-webhook-subscription.service.ts | 5 +---- .../workspace/services/workspace.service.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts b/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts index d5c4732e1c..69c0180686 100644 --- a/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts +++ b/packages/twenty-server/src/engine/core-modules/billing-webhook/services/billing-webhook-subscription.service.ts @@ -164,10 +164,7 @@ export class BillingWebhookSubscriptionService { } else if ( workspace.activationStatus === WorkspaceActivationStatus.SUSPENDED ) { - await this.workspaceRepository.update(workspaceId, { - activationStatus: WorkspaceActivationStatus.ACTIVE, - suspendedAt: null, - }); + await this.workspaceService.reactivateWorkspace(workspaceId); await this.messageQueueService.add( CleanWorkspaceDeletionWarningUserVarsJob.name, diff --git a/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts b/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts index 9b930d8173..6c1d3f50c4 100644 --- a/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts +++ b/packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts @@ -484,6 +484,17 @@ export class WorkspaceService extends TypeOrmQueryService { activationStatus: WorkspaceActivationStatus.SUSPENDED, suspendedAt: new Date(), }); + + await this.coreEntityCacheService.invalidate('workspaceEntity', id); + } + + async reactivateWorkspace(id: string) { + await this.workspaceRepository.update(id, { + activationStatus: WorkspaceActivationStatus.ACTIVE, + suspendedAt: null, + }); + + await this.coreEntityCacheService.invalidate('workspaceEntity', id); } async deleteWorkspace(id: string, softDelete = false) {