Files
vibn-frontend/app
Mark Henderson 4dd8974b43 fix(delete-project): cascade dev container + Coolify resources
The old /api/projects/delete only removed the fs_projects row.
Everything else — the dev container service in Coolify, the row in
fs_project_dev_containers, linked Coolify apps/services, and the
per-project Coolify project shell — kept existing as orphans. The
biggest user-visible consequence: ghost containers from deleted
projects keep counting against the 3-active-dev-container quota,
so users hit the cap with stuff they thought was already gone.
Smoke test on 2026-05-04 caught the user with 2/3 quota slots
held by ghosts from a previous Manifest project + Twenty CRM.

New cascade:
  1. Stop+delete dev container Coolify service (deleteVolumes,
     dockerCleanup, deleteConnectedNetworks all true).
  2. Delete every fs_project_resources-linked Coolify resource
     (apps + services; databases preserved because they hold user
     data and we have no signal the user wanted them destroyed).
  3. Delete the per-project Coolify project shell IF no other Vibn
     project still references it (legacy vibn-ws-* shared projects
     are skipped).
  4. Drop fs_project_dev_containers + fs_project_resources rows.
  5. Unlink fs_sessions (preserve content for re-association).
  6. Delete fs_projects row last.

Deliberately NOT deleted:
  - Gitea repo (user's code is sacred; URL returned in response).
  - Sentry project (error history is independent evidence).

Failures inside the cascade are logged but don't abort. A partial
delete leaves orphans for manual cleanup, which beats a rollback to
a half-deleted state.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-04 10:39:13 -07:00
..
2026-02-15 19:25:52 -08:00