From 692c76699edca81b54a3373ceedbe458adc40e63 Mon Sep 17 00:00:00 2001 From: "Pavel Tumik @ GitPod" <18602811+sagor999@users.noreply.github.com> Date: Fri, 12 Aug 2022 12:41:23 -0700 Subject: [PATCH 1/2] [server] fix using snapshotBucketId when it is undefined or empty --- components/server/src/workspace/workspace-starter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index 7984001102d64e..987997636175ba 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -1424,7 +1424,7 @@ export class WorkspaceStarter { } const volumeSnapshotId = - SnapshotContext.is(workspace.context) || WithPrebuild.is(workspace.context) + ((SnapshotContext.is(workspace.context) || WithPrebuild.is(workspace.context)) && workspace.context.snapshotBucketId !== undefined && workspace.context.snapshotBucketId != "") ? workspace.context.snapshotBucketId : lastValidWorkspaceInstanceId; From 14b392003764fa1883285a6c1a114998c9fd243f Mon Sep 17 00:00:00 2001 From: Pavel Tumik <18602811+sagor999@users.noreply.github.com> Date: Fri, 12 Aug 2022 12:49:52 -0700 Subject: [PATCH 2/2] Update components/server/src/workspace/workspace-starter.ts Co-authored-by: Kyle Brennan --- components/server/src/workspace/workspace-starter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index 987997636175ba..d1ef806f1e378d 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -1424,7 +1424,7 @@ export class WorkspaceStarter { } const volumeSnapshotId = - ((SnapshotContext.is(workspace.context) || WithPrebuild.is(workspace.context)) && workspace.context.snapshotBucketId !== undefined && workspace.context.snapshotBucketId != "") +((SnapshotContext.is(workspace.context) || WithPrebuild.is(workspace.context)) && !!workspace.context.snapshotBucketId) ? workspace.context.snapshotBucketId : lastValidWorkspaceInstanceId;