Skip to content

Ask the server which uploads are unused - #110

Merged
SiteRelEnby merged 1 commit into
mainfrom
fix/orphaned-file-detection
Oct 24, 2026
Merged

SiteRelEnby merged 1 commit into
mainfrom
fix/orphaned-file-detection

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Collaborator

From the docs pass. "Delete unused files" decided for itself which uploads were unused, from the system avatar and member avatars and nothing else. Banners, images embedded in bios and journal entries, and anything revision history still holds were all reported as unused, and the button then deleted them. The server does no reference check on a delete, so nothing downstream caught it.

Reproduced on an account whose only two uploads were a member avatar and the live system banner. The old build offered to permanently delete 1 file, which was the banner; the server's own dry run reported no orphans. After the change the screen reads "No unused files found".

It now asks POST /v1/files/cleanup/dry-run, which checks every place a file can be referenced, and matches the result back to the listing by storage key rather than serve URL, since the URL depends on how the instance serves files. That endpoint has existed since March, so there is no older-server case to handle.

Deliberately the dry run rather than POST /v1/files/cleanup: the real cleanup deletes server-side in one shot and skips System Safety's image category. Deleting one file at a time from here keeps that safeguard, which is the thing this client was already doing right.

Two more from the same screen, not fixed here: the storage card reads "514 B of 0 B used" because the server reports 0 for unlimited, and the export row still says "OpenPlural". Both are queued for the cosmetics batch.

"Delete unused files" decided that itself, from the system avatar and member
avatars and nothing else. Banners, images embedded in bios and journal entries,
and anything revision history still holds were all reported as unused, and the
button then deleted them. The server does no reference check of its own on a
delete, so nothing downstream caught it.

Reproduced on an account whose only two uploads were a member avatar and the
live system banner: the old build offered to permanently delete the banner,
while the server's own dry run reported no orphans at all.

It now asks `POST /v1/files/cleanup/dry-run`, which checks every place a file
can be referenced, and matches the result back to the listing by storage key
rather than by serve URL, since the URL depends on how the instance hands files
out. Deliberately the dry run rather than the real cleanup: that one deletes
server-side in one shot and skips System Safety's image category, so deleting
the files one at a time from here keeps the safeguard this client already
honoured.
@SiteRelEnby
SiteRelEnby merged commit 4546109 into main Oct 24, 2026
1 check passed
@SiteRelEnby
SiteRelEnby deleted the fix/orphaned-file-detection branch October 24, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant