fix(billing) - invalidate activationStatus after billing event (#22414)

Issue with workspaces still blocked after being re-activated

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22414?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Etienne
2026-07-02 10:24:35 +02:00
committed by GitHub
parent 3c13dc1ab8
commit 8182b2a07d
2 changed files with 12 additions and 4 deletions
@@ -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<CleanWorkspaceDeletionWarningUserVarsJobData>(
CleanWorkspaceDeletionWarningUserVarsJob.name,
@@ -484,6 +484,17 @@ export class WorkspaceService extends TypeOrmQueryService<WorkspaceEntity> {
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) {