mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7761] [Issue]: mari characters update --json drops other card extensions (shallow merge) #4284
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#4284
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 @ylli-selmani on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7761
Originally assigned to: @ylli-selmani on GitHub.
Summary
mari characters update <id> --json '...'merges the JSON patch shallowly into the card, so a patch that touches anything underextensionsreplaces the wholeextensionsobject. Every other extension on the card (appearance, backstory, depth prompt, onboarding, ...) is dropped.Expected behavior
Only the keys in the patch change, like
app_datacharacter.update, which deep-merges (deepMerge). For example,--json '{"extensions":{"depth_prompt":{...}}}'updates the depth prompt and keepsextensions.appearanceandextensions.backstory.Actual behavior
extensionsends up containing only what the patch sent. The other extensions are gone after the write is applied (they come back only by restoring an older character version).Steps to reproduce
mari characters update <id> --json '{"extensions":{"depth_prompt":{"prompt":"x","depth":4,"role":"system"}}}' --apply(or any JSON patch containingextensions).Found by reading the code, not yet reproduced in the app:
packages/server/src/services/mari-db/mari-db.service.ts, theupdatecase ofmari characters, uses{ ...existingData, ...patchData }. The fix PR adds a regression that fails on the current code.Environment
stagingateed2c7c22)Logs, screenshots, or video
None; code trace above.
Additional context
Blocks #7760 (Mari writing interactive onboarding), which needs safe writes into
extensions.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: