MCPcopy
hub / github.com/coder/mux / rollbackCreatedWorkspaces

Method rollbackCreatedWorkspaces

src/node/services/workspaceService.ts:3484–3507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3482 }> = [];
3483
3484 const rollbackCreatedWorkspaces = async (): Promise<void> => {
3485 for (const createdWorkspace of [...createdWorkspaces].reverse()) {
3486 const trusted =
3487 configSnapshot.projects.get(stripTrailingSlashes(createdWorkspace.project.projectPath))
3488 ?.trusted ?? false;
3489 try {
3490 // Rollback only removes the just-created workspace path; forcing deletion could
3491 // also drop an older same-named branch in worktree runtimes.
3492 await createdWorkspace.runtime.deleteWorkspace(
3493 createdWorkspace.project.projectPath,
3494 branchName,
3495 false,
3496 initAbortController.signal,
3497 trusted
3498 );
3499 } catch (error: unknown) {
3500 log.error("Failed to roll back multi-project workspace creation", {
3501 workspaceId,
3502 projectPath: createdWorkspace.project.projectPath,
3503 error: getErrorMessage(error),
3504 });
3505 }
3506 }
3507 };
3508
3509 for (const projectRuntimeEntry of projectRuntimeEntries) {
3510 const trusted =

Callers

nothing calls this directly

Calls 4

stripTrailingSlashesFunction · 0.90
getErrorMessageFunction · 0.90
getMethod · 0.65
deleteWorkspaceMethod · 0.65

Tested by

no test coverage detected