mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4901] [MERGED] fix: make Persona client writes race-safe #6534
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#6534
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4901
Author: @Xelvanis
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/persona-decoded-client-writes-pruned📝 Commits (3)
2dbc427fix: make persona client writes race-safe2fcf42dfix: address Persona review feedbacka6450b3Merge origin/staging into fix/persona-decoded-client-writes-pruned📊 Changes
17 files changed (+1333 additions, -369 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
package.json(+3 -1)➕
packages/client/.regression-fixtures/persona-mutation-types.ts(+37 -0)📝
packages/client/src/components/bot-browser/BotBrowserView.tsx(+1 -1)📝
packages/client/src/components/characters/CharacterEditor.tsx(+5 -7)📝
packages/client/src/components/modals/ImportPersonaModal.tsx(+8 -45)📝
packages/client/src/components/panels/PersonasPanel.tsx(+1 -1)📝
packages/client/src/components/panels/settings/TrackerCardColorSettings.tsx(+4 -4)📝
packages/client/src/components/personas/PersonaEditor.tsx(+588 -203)➕
packages/client/src/components/personas/persona-editor-transitions.ts(+104 -0)📝
packages/client/src/features/tracker-panel/hooks/use-persona-portrait-save.ts(+2 -2)📝
packages/client/src/hooks/use-characters.ts(+90 -104)📝
packages/client/src/lib/api-client.ts(+17 -0)➕
packages/client/src/lib/persona-cache.ts(+50 -0)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
scripts/regressions/avatar-crop-contract.regression.ts(+27 -1)➕
scripts/regressions/persona-client-contract.regression.ts(+393 -0)📄 Description
Linked issue
Follow-up to #4646. That issue is already closed and cannot be reopened; PR #4857 completed its strict server/import/export boundary and explicitly left the built-in client write migration as a separate follow-up. This PR completes that client phase.
Why this change
Persona fields such as tags, stats, tracker configuration, conversation behavior, and avatar crops are structured values at the API boundary. First-party client callers still serialized some of them manually, and the editor treated saves as whole-form operations whose responses could race later edits or older reads.
Persona writes should use the shared decoded contract end to end. Successful server responses should become authoritative without allowing an older GET to overwrite them, and saving must not erase edits made while a request is still running or let incompatible avatar/Delete operations overlap.
What changed
regression:issuesimmediately after card-library search.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated and focused checks completed
On the rebased commit whose parent is freshly fetched
origin/staging:pnpm install --frozen-lockfilepnpm regression:persona-clientpnpm regression:avatar-crop-contractpnpm checkgit diff --check origin/staging...HEADpnpm check94445688...review confirmed all 16 non-changelog path patches stable and independently passed the focused Persona regressionThe final branch was rebased onto freshly fetched
origin/stagingat94445688fed98b922a3d0ac9e6bc66aa83320718. The final rebase conflicted only inCHANGELOG.md; current staging's Feature-agent and Guide entries plus the Persona entry were preserved exactly once. Earlier package-script integration remained intact.Manual verification notes
An isolated headed local-browser session covered the final reviewed production source immediately before the rebase. The rebase changed only changelog/script integration, and the later amendment removed only approved regression source-ledger assertions; no production behavior changed. Full post-amend validation above passed.
Persona name cannot be empty. Enter a name before saving.Request-delay/edit-during-save, busy Back/Delete, stale-GET, and Delete-confirmation A→B timing remain permanent regression/source proof because the approved browser boundary forbids interception, eval, and storage manipulation. Gallery assignment preview passed, but a separate close/reopen crop-replacement observation was not completed.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG.mdcontains the user-facing entry. Nodocs/, translated documentation, installation/update guidance, or version-bearing files changed.UI evidence (if applicable)
This changes editor behavior rather than visual styling. The isolated proof exercised desktop and mobile warning controls; screenshots were intentionally kept only inside the disposable owned browser runtime and removed with that runtime. No image asset is committed.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.