mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2328] [Issue]: Character/persona sprite directories are never deleted on entity delete (disk leak) #1156
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1156
Loading…
Add table
Add a link
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?
Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2328
Originally assigned to: @Romuromylus on GitHub.
Summary
Severity: Low — Disk leak. Character and persona sprite directories (
<data_dir>/sprites/<characterId>,<data_dir>/sprites/personas/<personaId>) are never deleted when the owning character/persona is deleted.remove_owned_mediahas no sprites branch and there is no startup orphan-prune, so a deleted entity's whole sprite pack (up to ~28 PNGs) leaks permanently with no UI to reach it.Expected behavior
Deleting a character or persona should remove its sprite directory, mirroring how avatar/gallery/lorebook-image files are cleaned on delete.
Actual behavior
src-tauri/src/commands/storage/commands/entities.rs:1931-1942:The
DeleteCleanupenum (contracts.rs:17-27) has no sprite variant;CHARACTER_CLEANUP= RemoveOwnedMedia + DeleteCharacterGallery, personas use RemoveOwnedMedia only. Sprite files are written outside the DB byupload_sprite/upload_sprites(sprites.rs:346,371) intosprites_dir/persona_sprites_dir.delete_spriteonly removes a single expression (per-expression command), not the dir on entity delete. Even the admin bulk-expunge misses them:clear_collectionsonly clears the legacyspritesDB collection, andclear_runtime_media(admin.rs:127-141)remove_dir_alls avatars/fonts/knowledge-sources/game_assets/backgrounds but NOTsprites.Steps to reproduce
sprites/<id>(orsprites/personas/<id>) and all its PNGs remain on disk forever.Impact area
Environment
b0e5561dLogs, screenshots, or video
Static source audit; cited to file:line above.
Regression notes
Found via static audit of the refactor branch; not verified against main. Bounded local disk waste, no correctness/data-loss/security impact, hence low.
Additional context
Suggested fix: add sprite-dir cleanup on character and persona delete — a
DeleteCleanup::RemoveOwnedSpritesvariant wired intoCHARACTER_CLEANUPand the persona contract, or extendremove_owned_mediato best-effortfs::remove_dir_allthe owner's sprite dir (usingsprites_dir/persona_sprites_dir, logging on error like avatar cleanup). The persona-expunge admin scope should likewise gain sprites cleanup.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@Romuromylus commented on GitHub (Jun 6, 2026):
Fixed by #2378, merged into
refactor(squashfa79513b).