mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2186] [Issue]: Lorebook entry transfer preserves source folder IDs #1091
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#1091
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 @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2186
Originally assigned to: @Promansis on GitHub.
Summary
Lorebook entry transfer in the refactor preserves source folder IDs when copying or moving entries to another lorebook. This can leave moved/copied entries pointing at folders that do not exist in the target lorebook.
Expected behavior
Copying or moving entries between lorebooks should preserve the entry content and activation fields, but should clear or correctly remap
folderIdfor the target lorebook. Legacy transfer placed transferred entries at root in the target (folderId: null) and appended them after existing target entries.Actual behavior
The refactor implements transfer in the frontend hook:
movepatches onlylorebookIdon the existing entry.copyclones the whole entry object, deletesid, and creates it under the targetlorebookId.Both paths can preserve a
folderIdfrom the source lorebook. If the target lorebook does not have a folder with the same ID, the stored entry becomes orphaned from the target's folder model.Steps to reproduce
refactor, create source lorebook A with a folder and an entry inside that folder.lorebookIdfor B but still carries the source folder ID.Impact area
Environment
upstream/refactor577de008; compared against legacyupstream/mainc49f1d95Logs, screenshots, or video
Static parity evidence:
src/features/catalog/lorebooks/hooks/use-lorebooks.ts.moveupdates only{ lorebookId: targetLorebookId }.copyclones the source entry and creates it with a newlorebookId, without clearingfolderId.buildTransferredEntryInputinpackages/server/src/routes/lorebooks.routes.ts, explicitly settingfolderId: nulland assigning a target append order.Relevant legacy behavior:
inside the transferred entry input for both copy and move.
Regression notes
This worked in the legacy
mainbranch transfer route. The refactor moved transfer behavior into the frontend hook, but did not preserve the storage safety rule that transferred entries should not keep source-folder ownership.Additional context
This came from the Batch 3 Storage Safety parityscan row
07-LB-STORAGE-entry-transfer. A robust fix likely belongs in the storage/Rust command layer or a focused lorebook command wrapper, so embedded and remote runtime behavior stay identical and malformed callers cannot create cross-lorebook folder references.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: