mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4927] [Issue]: Professor Mari lorebook entry mutations skip syncCharacterBookFromLorebook (stale embedded character book) #2730
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#2730
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 @kolacheee on GitHub (Aug 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4927
Originally assigned to: @kolacheee on GitHub.
Summary
Every Professor Mari
app_datalorebook entry mutation —lorebook.create(with entries),addEntry,updateEntry, and nowdeleteEntry(#4924) — goes through the genericmari-dbmutation path and never callssyncCharacterBookFromLorebook. Only the HTTP routes (packages/server/src/routes/lorebooks.routes.ts) call it after a mutation. So when Mari edits a lorebook that is a character's embedded book (data.character_book), the character's derived copy is left stale, on both apply and Restore.Expected behavior
After Mari adds, updates, or deletes a lorebook entry, any character whose embedded
data.character_bookderives from that lorebook is resynced (and re-synced again if the change is Restored), matching the HTTP route behavior.Actual behavior
executeMutation/applyPlaninmari-db.service.tswritelorebook_entriesdirectly with nosyncCharacterBookFromLorebookcall, so the embedded character book drifts out of sync for all of Mari's entry mutations.Steps to reproduce
data.character_book).data.character_bookstill reflects the old entries.Environment
Additional context
Surfaced by CodeRabbit on #4926 (the
lorebook.deleteEntryPR), but it is pre-existing and systemic —addEntry/updateEntry(shipped in #4791/#4796) already have the same gap;deleteEntryjust follows the established pattern. The fix belongs in the generic mutation/restore path so it covers all of Mari's lorebook entry mutations on both apply and Restore (a heavier change than #4924's focused scope), with regression coverage for apply and Restore against an embedded-book character.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: