mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2330] [Issue]: Sprite cleanup restore-points accumulate unbounded with no cap or cleanup path #1157
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#1157
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/2330
Originally assigned to: @Xelvanis on GitHub.
Summary
Severity: Low — Disk leak. Each "Clean saved sprites" run creates a
.cleanup-restore-points/<millis>-<id>/directory holding a full copy of every cleaned sprite plus a manifest. These are only deleted on a fully-successful restore of that exact point; there is no cap and no UI to list/clear them, so the common iterate-cleanup workflow leaves a full duplicate sprite set on disk after every run.Expected behavior
Retained restore points should be capped (keep the most recent N, prune older), and/or there should be a way to clear them.
Actual behavior
src-tauri/src/commands/storage/sprites.rs:462-514(clean_saved_sprites):Each run copies every cleaned sprite into the new dir (line 480). The dir is removed inline only if nothing was cleaned (503-504), or on a fully-successful restore of that exact id (
restore_sprite_cleanup_point, 593-595). A repo-wide grep finds.cleanup-restore-pointsreferenced only atsprites.rs:463/:540— no mtime prune, no N-cap, no clear command. The UI (CharacterSpritesTab.tsx) tracks only a singlelastCleanupRestorePointIdin component state, overwritten each run (so prior runs' dirs become unreferenced) and reset on unmount. These dirs are excluded from profile export (collect_profile_assetsskips dot-prefixed names), so this is a local-disk-only leak.Steps to reproduce
.cleanup-restore-points/<id>folder with a copy of every sprite.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. Local-disk-only, bounded per run, grows only as fast as the user re-runs cleanup, hence low.
Additional context
Suggested fix: at the start of
clean_saved_sprites, enumerate.cleanup-restore-points/subdirs and prune all but the most recent N by the<millis>prefix (or by mtime); and/or expose a clear-restore-points command + UI.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: