Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ class TestPrebuildStateMapper {
},
},
{
name: "failed - no snapshot",
expected: {
state: "failed",
hasError: true,
},
name: "Stopping and no snapshot yet",
expected: undefined,
status: {
id,
phase: WorkspacePhase.STOPPING,
Expand Down
11 changes: 3 additions & 8 deletions components/ws-manager-bridge/src/prebuild-state-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,12 @@ export class PrebuildStateMapper {
update: {
state: "available",
snapshot: status.conditions!.snapshot,
error: "",
},
};
} else if (!status.conditions!.snapshot) {
// STOPPING && no snapshot? Definitely an error case
return {
type: HeadlessWorkspaceEventType.Failed,
update: {
state: "failed",
error: "error while taking snapshot",
},
};
// STOPPING && no snapshot is an intermediate state that we are choosing to ignore.
return undefined;
} else {
log.error({ instanceId: status.id }, "unhandled prebuild status update", {
phase: status.phase,
Expand Down