mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2187] [Issue]: Lorebook folder delete leaves stale entry folder IDs #1090
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#1090
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/2187
Originally assigned to: @Promansis on GitHub.
Summary
Deleting a lorebook folder in the refactor removes the folder row but does not reparent child entries in storage. The editor visually falls back stale
folderIdentries to root, but the persisted entry records keep a pointer to a deleted folder.Expected behavior
Deleting a lorebook folder should persistently set every entry in that folder back to root level (
folderId: null) before or during folder deletion, scoped to the same lorebook.Actual behavior
The refactor uses generic
storage_delete("lorebook-folders", folderId)for folder deletion. No Rust cleanup path clearslorebook-entries.folderIdfor that folder, so entries can retain a stale folder ID after the folder row is gone.Steps to reproduce
refactor, create a lorebook with one folder and at least one entry inside that folder.lorebook-entriesrow for the entry.folderIdstill points to the deleted folder.Impact area
Environment
upstream/refactor577de008; compared against legacyupstream/mainc49f1d95storage_deleteLogs, screenshots, or video
Static parity evidence:
src/features/catalog/lorebooks/hooks/use-lorebooks.tslorebook-folderschild reparent cleanup:src-tauri/src/commands/storage/commands/entities.rssrc/features/catalog/lorebooks/components/editor/LorebookEditor.tsxpackages/server/src/services/storage/lorebooks.storage.tsRelevant legacy behavior:
Regression notes
This worked in the legacy
mainbranch storage service. The refactor kept the UI message that entries are moved back to root, but the persistence cleanup is missing.Additional context
This came from the Batch 3 Storage Safety parityscan row
07-LB-STORAGE-crud-folders. The issue is storage-level, not just UI-level: hidden stalefolderIdvalues can affect future exports, imports, runtime activation gating, and any storage consumer that does not apply the editor fallback.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: