mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1551] [Issue]: Reimporting a character embedded lorebook creates duplicate linked lorebooks #796
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#796
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 @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1551
Originally assigned to: @Promansis on GitHub.
Summary
Reimporting a character's embedded lorebook creates a new linked lorebook every time instead of updating/reusing the existing linked lorebook.
Expected behavior
After a character's embedded lorebook has been imported once, clicking "Reimport Embedded Lorebook" or calling
character_embedded_lorebook_importagain should either update/replace the existing linked lorebook or clearly ask before creating a duplicate. The API'sreimportedfield should accurately reflect the behavior.Actual behavior
Native Tauri QA created a character with one embedded
character_bookentry. The firstcharacter_embedded_lorebook_importcall created and linked a lorebook correctly. A second call created a second lorebook for the same character, moved the character metadata pointer to the new lorebook, left the previous lorebook behind, and still returnedreimported: false.Steps to reproduce
data.character_book.entriescontains at least one entry.character_embedded_lorebook_importfor that character id.data.extensions.importMetadata.embeddedLorebook.lorebookIdpointing at the created lorebook.characterIdorsourceCharacterIdis the character id.reimported: false.Impact area
Environment
origin/refactoratf120eb33v24.16.0, pnpm10.33.2rustc 1.95.0Logs, screenshots, or video
No public screenshot needed. Native QA proof showed first import returning one
lorebookId, second import returning a differentlorebookId, and two lorebooks remaining with the same character id linkage.Regression notes
Not checked against an older branch. Found during the Lorebooks native QA pass on the current refactor branch.
Additional context
Likely owner is
src-tauri/src/commands/storage/exports.rs::import_character_embedded_lorebook(...). The current path appears to always create a newlorebooksrecord, then patchesdata.extensions.importMetadata.embeddedLorebookto the latest id.Acceptance criteria:
reimportedis true when an existing embedded lorebook link is reused/replaced.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: