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
6 changes: 6 additions & 0 deletions .server-changes/fix-slow-project-deletion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Deleting a project no longer triggers a slow database cleanup that could hang on projects with many runs.
4 changes: 2 additions & 2 deletions apps/webapp/app/services/archiveBranch.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export class ArchiveBranchService {
}

// Branch archive is a SOFT update — do NOT hard-delete run-ops rows here (it would destroy a
// retained branch's history). RunOpsCascadeCleanupService.cleanupEnvironment belongs on the
// env hard-delete/purge path (owned by the cloud env-purge runbook), which has no site today.
// retained branch's history). Any env hard-delete/purge belongs on a dedicated purge path
// (owned by the cloud env-purge runbook), which has no site today.
const slug = `${environment.slug}-${nanoid(6)}`;
const shortcode = slug;

Expand Down
5 changes: 1 addition & 4 deletions apps/webapp/app/services/deleteProject.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { prisma } from "~/db.server";
import { marqs } from "~/v3/marqs/index.server";
import { engine } from "~/v3/runEngine.server";
import { controlPlaneResolver } from "~/v3/runOpsMigration/controlPlaneResolver.server";
import { RunOpsCascadeCleanupService } from "~/v3/runOpsMigration/runOpsCascadeCleanup.server";

type Options = ({ projectId: string } | { projectSlug: string }) & {
userId: string;
Expand Down Expand Up @@ -51,9 +50,7 @@ export class DeleteProjectService {
});
}

// Hard-delete the project's run-ops rows across both run-ops DBs (replaces the cloud-only
// dropped cross-seam FK cascades). Idempotent; uses the run-ops writers, not #prismaClient.
await new RunOpsCascadeCleanupService().cleanupProject(project.id);
// Soft delete only: run-ops rows are intentionally retained (no hard-delete cascade here).
Comment thread
d-cs marked this conversation as resolved.

// Mark the project as deleted (do this last because it makes it impossible to try again)
// - This disables all API keys
Expand Down
275 changes: 0 additions & 275 deletions apps/webapp/app/v3/runOpsMigration/runOpsCascadeCleanup.server.ts

This file was deleted.

Loading