mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2172] [Issue]: Persona duplicate preserves active state #1082
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#1082
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/2172
Originally assigned to: @Promansis on GitHub.
Summary
Duplicating the active persona on the refactor branch can preserve the source persona's active flags, leaving more than one persona marked active.
Expected behavior
Duplicating a persona should create an inactive copy. Legacy
mainforced duplicated personas toisActive: "false", so the existing active persona stayed the only active persona until the user explicitly activated another one.Actual behavior
The refactor duplicate path uses generic
storage_duplicateforpersonas. That path removes theidand copies the rest of the row, so an active source persona can produce a duplicate withisActiveand/oractivestill truthy. The explicit persona activation command enforces uniqueness, but duplicate bypasses that invariant.Steps to reproduce
refactor, create or select a persona and activate it.personasrows or reload the persona selector.Impact area
Environment
refactorstatic trace at7d4f39f4; legacy referencemainat77a30fa4Logs, screenshots, or video
Static evidence:
src/shared/api/storage-commands-api.tscallsstorage_duplicate.src-tauri/src/commands/storage/commands/entities.rsonly special-cases characters, prompts, chat presets, connections, and messages;personasfall through to generic duplicate.src-tauri/src/commands/storage/shared.rsremovesidand appendsCopytoname, but does not clearisActiveoractive.src-tauri/src/commands/storage/personas.rspatches every persona to exactly one active row, proving uniqueness is still an expected invariant.main:packages/server/src/services/storage/characters.storage.tsduplicatePersonainserted the copy withisActive: "false".Regression notes
Worked on legacy
main: duplicated personas were always inactive. The refactor storage command is broader and currently misses the persona-specific active-state reset.Additional context
Found during the Contracts + Storage Base parityscan slice for
crud-active-duplicate. Likely fix: special-casepersonasinduplicate_entityor a persona-owned duplicate helper, clearing bothisActiveandactiveon the copy before create. Add focused storage proof for duplicating active and inactive personas.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: