mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4669] [MERGED] fix: clean up deleted avatars and retain summary history #6461
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#6461
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4669
Author: @SpicyMarinara
Created: 8/6/2026
Status: ✅ Merged
Merged: 8/6/2026
Merged by: @SpicyMarinara
Base:
staging← Head:agent/4668-avatar-file-cleanup📝 Commits (6)
2f72f9cchore: start issue 4668 avatar cleanup5b77673fix avatar cleanup after card deletion334b236address avatar review and retain summary historye0c5da1fix: address avatar upload and summary review feedbacka1c62eafix: make avatar persistence atomic57fa69ffix: snapshot current persona atomically📊 Changes
10 files changed (+823 additions, -178 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
package.json(+2 -1)📝
packages/server/src/routes/admin.routes.ts(+49 -6)📝
packages/server/src/routes/characters.routes.ts(+31 -6)📝
packages/server/src/routes/chats.routes.ts(+2 -4)➕
packages/server/src/services/image/avatar-file-lifecycle.ts(+184 -0)📝
packages/server/src/services/storage/characters.storage.ts(+211 -159)📝
packages/shared/src/utils/chat-summary-entries.ts(+14 -0)➕
scripts/regressions/avatar-file-deletion.regression.ts(+251 -0)📝
scripts/regressions/open-issues.regression.ts(+77 -2)📄 Description
Linked issue
Closes #4668
Why this change
data/avatars. Danger Zone used the same database-only deletion path, and card-version rows meant one deleted card could leave several historical avatar files behind.What changed
/api/avatars/file/<filename>route for deletion; external URLs, NPC paths, invalid encodings, nested paths, and traversal paths are ignored.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm regression:avatar-deletepassed after the review changes.pnpm checkpassed (localization, lint/type checks, server/client production builds).open-issues.regression.tscurrently stops earlier on an unrelated pre-existing mobile-keyboard source-distance assertion onstaging; the new runtime behavior was verified independently.Docs and release impact
No docs changes needed
Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
Translated docs on the
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Version/release files updated (only if this PR includes a version bump)
Added two Unreleased changelog entries. No user-facing documentation, translation, or version metadata changes are needed.
UI evidence (if applicable)
Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.