mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8130] [MERGED] fix(avatars): preserve frozen chat identity files during cleanup #8117
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#8117
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/8130
Author: @SpicyMarinara
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/frozen-avatar-gc📝 Commits (7)
753448echore: track frozen avatar cleanup fixb181f6cfix(avatars): preserve frozen identity history during cleanupe92d694fix(avatars): stop history scans after candidates are protected4607345test(avatars): prove cleanup transaction prevents evictiondf361f2docs(avatars): explain cleanup consistency boundariesf1fb191fix: scan frozen avatar history outside write gates8fb9503Merge commit '1ffb916dfb' into fix/frozen-avatar-gc📊 Changes
7 files changed (+1050 additions, -133 deletions)
View changed files
📝
packages/server/src/db/file-backed-store.ts(+12 -4)📝
packages/server/src/routes/chats.routes.ts(+39 -29)📝
packages/server/src/routes/generate.routes.ts(+32 -28)📝
packages/server/src/services/image/avatar-file-lifecycle.ts(+204 -72)➕
scripts/regressions/avatar-frozen-identity-cleanup.regression.ts(+431 -0)➕
scripts/regressions/file-store-load-heal-generation.regression.mjs(+261 -0)📝
scripts/regressions/persona-api-decoded-reads.regression.ts(+71 -0)📄 Description
Linked issue
Closes #8112
Why this change
Avatar cleanup can delete a persona image that saved messages still use through frozen identities. Inactive swipes and restorable message trash can lose their images too. Cleanup must also respect pending historical-identity changes and rollback without blocking chat writes throughout a cold-history scan.
What changed
No schema migration, release metadata, dependency, user-facing documentation, or UI copy changes are needed.
Validation
Local macOS arm64 / Node 24.22.1:
pnpm install --frozen-lockfileandpnpm checkpassed before the staging refresh. After mergingstagingat1ffb916df, frozen installation with the official pinned pnpm 12.15.0 and all twelve focused files passed again; the refreshed full check is recorded below.scan must not hold the write gate during cold I/O; restored current source passes. The initial collector and historical-reassignment API had separate data-loss negative controls earlier in this PR.Fresh full local CodeRabbit review completed with 0 findings across all seven PR files, including the load-heal counter fixture. It reviewed the complete Avatar diff against original base
957cb117; all seven reviewed files are SHA256-identical after merging current staging1ffb916df. Final integration head:8fb95039021cf9c3203c300d110e1a14a820bfd0. The fullpnpm checkalso passed at that integration head under pinned pnpm 12.15.0 (one existing client hook-dependency warning, zero errors).Earlier review findings and their source-based dispositions remain in the PR discussion. This revision replaces the previously accepted whole-scan write-gate tradeoff: cold history I/O now runs outside both gates. Earlier eviction assumptions no longer describe the design; captured resident references plus final generation validation are the safety boundary.
Manual verification
Proof boundaries
The automated storage/API cases use disposable data and injected failures, not real user data or live providers. Prior desktop shell smoke passed 7/7; this revision changes only server storage/lifecycle behavior, so it does not add new browser or physical-device proof. Earlier hosted checks apply to their recorded heads; new-head CI and Dottore Review must pass before merge. One focused test initially hit another test's default-storage writer lease before its assertions; its unchanged isolated-runner replay passed. Cold scans can still take time and final checks/unlinks serialize briefly with writers; no latency SLA is claimed. Images already deleted by earlier cleanup need restoration from a backup.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.