mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1508] [Issue]: Roleplay background persists after switching to a chat with no background #757
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#757
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/1508
Originally assigned to: @Xelvanis on GitHub.
Summary
Roleplay can keep showing the previous chat's background after switching to a different Roleplay chat/branch whose metadata has no background configured.
Expected behavior
Switching from a Roleplay chat with a configured background to a Roleplay chat with
metadata.background: nullshould clear the visible background immediately, without requiring a reload.Actual behavior
The sprite overlay and pinned image overlay clear correctly on chat switch, but the old background remains visible. Reloading while the no-background chat is active clears it, so the persisted metadata is correct and the stale state appears to be in the live chat-switch path.
Steps to reproduce
http://localhost:1420/logo.pngas disposable local media.metadata.background: null.Impact area
Environment
origin/refactorat229e7d89(Fix PR 1499 review follow-ups)v24.16.0, pnpm10.33.21.95.0, cargo1.95.0Logs, screenshots, or video
Local QA screenshots captured during the audit:
scratch/roleplay-audit-a10-original-background-sprite.png: source Roleplay chat with background and sprite visible.scratch/roleplay-audit-a10-branch-after-media-switch.png: branch/no-background chat after sidebar switch; old background still visible while sprite and pinned overlay are gone.Observed DOM/computed-state evidence:
url("http://localhost:1420/logo.png").background: null.url("http://localhost:1420/logo.png").none, confirming persisted metadata was not the source of the stale visible background.Regression notes
Found during the 2026-05-29 Roleplay mode audit on latest
origin/refactor. No earlier known-good commit identified.Additional context
Likely area to inspect:
src/features/modes/shared/chat-ui/hooks/use-chat-metadata-sync.ts. The restore effect appears to run onchat?.idwhile reading metadata values that may hydrate after the chat id changes; if the first render for the new chat still has the previous background value, the background store can be restored with stale data and not rerun when the new metadata arrives.Related code paths inspected during the audit:
src/features/modes/shared/chat-ui/ChatRoleplaySurface.tsxsrc/features/modes/shared/chat-ui/hooks/use-chat-metadata-sync.tssrc/features/modes/shared/chat-ui/components/CrossfadeBackground.tsxDuplicate check:
gh issue list --repo Pasta-Devs/Marinara-Engine --state all --search "Roleplay background persists after switching chat background"returned no matches.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: