Skip to content

Commit 8ffcb7a

Browse files
committed
[server] move "not-deleted" check into WorkspaceService.startWorkspace
1 parent da8a7a4 commit 8ffcb7a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

components/server/src/workspace/gitpod-server-impl.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
927927
};
928928
}
929929

930-
if (!!workspace.softDeleted) {
931-
throw new ApplicationError(ErrorCodes.NOT_FOUND, "Workspace not found!");
932-
}
933930
// (gpl) We keep this check here for backwards compatibility, it should be superfluous in the future
934931
// no matter if the workspace is shared or not, you cannot create a new instance
935932
await this.guardAccess({ kind: "workspaceInstance", subject: undefined, workspace }, "create");

components/server/src/workspace/workspace-service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ export class WorkspaceService {
259259
throw new ApplicationError(ErrorCodes.BAD_REQUEST, "Cannot (re-)start irregular workspace.");
260260
}
261261

262+
if (!!workspace.softDeleted) {
263+
throw new ApplicationError(ErrorCodes.NOT_FOUND, "Workspace not found!");
264+
}
265+
262266
const envVarsPromise = this.envVarService.resolve(workspace);
263267
const projectPromise = workspace.projectId
264268
? ApplicationError.notFoundToUndefined(this.projectsService.getProject(user.id, workspace.projectId))

0 commit comments

Comments
 (0)