Deleting a project leaves its documentation on disk forever #164
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
qwc-open/asiakirjat#164
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Noticed while investigating #163.
handleAdminDeleteProject(internal/handler/admin_projects.go:389) removes the project's versions from the search index, then callsh.projects.Delete, which is a bareDELETE FROM projects WHERE id = ?. Nothing in that path touches storage, andFilesystemStoragehas noDeleteProjectmethod at all — onlyDeleteVersion.So every project ever deleted has left its entire directory under
storage.base_pathbehind, with all versions in it. Nothing ever reads those directories again and nothing reports them, so the disk usage just grows.Why it matters beyond the wasted space
versionsrows naming theirstorage_pathhad to be dumped before the orphan cleanup could remove them.Fix
Give the storage interface a
DeleteProject(slug)and call it from the delete handler after the database row is gone, logging rather than failing the request if the directory cannot be removed — the project is deleted either way, and a half-failed delete should not leave the row behind.Existing leftover directories are not cleaned up by this; they have no rows pointing at them any more. Worth a separate look at whether startup's
ReconcileStorageshould report directories with no project.Assisted-by: Claude Opus 5