From 61f762523877785ad0803420d3fea37fd3cc9088 Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Fri, 14 Mar 2025 15:18:48 +0100 Subject: [PATCH] Compute any new `Workspace` version from `APP_VERSION` (#10893) # Introduction We want any new activated workspace to be filled with a version equal to the current `APP_VERSION` Please note that in a workspace lifecycle this operation will be run only once, discussed with @charlesBochet in front of `3 fois plus de piments` Going straightforward in this PR in order to release asap Started et will continue to implem new integrations regarding `SignUp` and `ActivateWorkspace` happy and expections path in https://github.com/twentyhq/twenty/tree/prastoin-new-workspace-has-version-integrations-tests --- .../core-modules/workspace/services/workspace.service.ts | 3 +++ 1 file changed, 3 insertions(+) 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 b403fdf4c..66cf89f01 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 @@ -271,9 +271,12 @@ export class WorkspaceService extends TypeOrmQueryService { }); await this.userWorkspaceService.createWorkspaceMember(workspace.id, user); + const appVersion = this.environmentService.get('APP_VERSION') ?? null; + await this.workspaceRepository.update(workspace.id, { displayName: data.displayName, activationStatus: WorkspaceActivationStatus.ACTIVE, + version: appVersion, }); return await this.workspaceRepository.findOneBy({