mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #8112] [Issue]: Avatar storage cleanup deletes frozen chat identity images #7566
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#7566
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 @SpicyMarinara on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8112
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The existing avatar storage cleaner treats a local image as abandoned even when a saved user message still displays it through
extra.personaSnapshot.avatarUrl. Reproduced against the cleanup code currently on staging (7217a4b550fbc37230debf87c247eaacf4ea4baa) using an isolated file database and one valid PNG.Expected behavior
A frozen chat identity keeps its avatar image available after the current persona changes or is removed. Cleanup must also account for historical swipe metadata and recoverable message-trash snapshots before unlinking files.
Actual behavior
The reference collector in
packages/server/src/services/image/avatar-file-lifecycle.tschecks characters, character versions, personas, persona versions and groups. It does not read frozen message identities. The read-only scan reports the referenced PNG as abandoned, and cleanup deletes it.The isolated reproducer returned:
Reproduction
extra.personaSnapshot.avatarUrlpointing to a local avatar, without a current card/version owning that file (for example after replacing an unversioned persona avatar).Complete isolated reproducer: download the
.mtsfile and run it from the repository withpnpm --filter @marinara-engine/server exec tsx /path/to/marinara-frozen-avatar-gc-audit.mts. It creates and removes its own temporary database and files; the clock advances only inside the test input.Source trace:
generate.routes.tsstoresresolvedUserIdentity.avatarPathin a user message snapshot;ConversationMessage.tsxreads that snapshot to keep old identities stable.message-trash.storage.tskeeps the message and swipe rows for restore.Fix boundaries
This is an existing garbage-collection follow-up, separate from the persona avatar removal UI in #8097. That UI now deliberately clears only the current card reference and retains files, with a regression proving frozen chat avatars continue to return HTTP 200.
Ownership: @SpicyMarinara / Codex triaged this with a source trace and runnable proof. No implementation branch has been started for this broader cleanup work.
@SpicyMarinara commented on GitHub (Oct 23, 2026):
Ownership: @SpicyMarinara / Codex is implementing this in the isolated
fix/frozen-avatar-gcbranch. I am checking frozen current messages, historical swipes and recoverable trash without forcing lazy chat storage fully into memory, including cleanup-read failures and concurrent writes.@SpicyMarinara commented on GitHub (Oct 23, 2026):
Fixed on staging by #8130 (merge
5d64e0f993). The reviewed head passed all eight required checks, all ten platform jobs, the full Node regression suite, local CodeRabbit, and Dottore Review with no defects. Frozen identities in messages, historical swipes and restorable trash now protect their avatar files; cold scans release the write gate and fail closed on concurrent history changes. Images already deleted by earlier cleanup require restoration from a backup. The post-merge container and regression workflows are running; their results are separate from the passed PR checks.