mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3001] [Issue]: Agent store reset() leaks Custom Music DJ playback state across chat switches (localMusicPlay/localMusicVolume never cleared) #1575
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#1575
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 @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3001
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The agent store's
reset()action (the chat-switch teardown) clears the YouTube DJ playback intent but omits the analogous Custom (local file) Music DJ fields. So the Custom Music DJ "play" intent from the previous chat survives a chat switch. When the local music player remounts (e.g. on a viewport toggle or the 767px breakpoint crossing), its nonce-based effect sees the stale intent and auto-starts playback of the PREVIOUS chat's track inside the new chat. YouTube is protected because reset() nulls its play intent; local music is not.How to reproduce (try it yourself)
You'll see: on remount the effect auto-plays chat A's track inside chat B.
Expected: a chat switch wipes the previous chat's Custom DJ track, exactly as it does for YouTube.
Where it is
packages/client/src/stores/agent.store.ts:281-300(reset— missing localMusicPlay/localMusicVolume; fields declared at 127-129). Chat-switch teardown:packages/client/src/stores/chat.store.ts:295-296. Stale-state auto-play:packages/client/src/components/chat/LocalMusicPlayer.tsx:141-164; remount path at:471-478. YouTube guard contrast:YouTubePlayer.tsx:219.What's happening
reset()was written by enumerating fields to clear and the local-music pair was simply omitted, unlike its YouTube twin. The dedicatedclearLocalMusic()action exists but is only invoked from the player's manual close handler, never on chat switch, so nothing compensates.Suggested fix
Add the two fields to the
reset()set() object, immediately after the youtube lines (around 296-297):No regression: both reset() callers are teardown contexts where clearing is intended; nulling localMusicPlay is the protective change (the play effect early-returns on
!localMusicPlay, matching YouTube's guard); nulling localMusicVolume is a no-op for the volume effect and does NOT touch the persisted playerVolume, so the user's chosen volume is unaffected. The existingclearLocalMusic()already nulls exactly these two fields, confirming null is the canonical cleared state.AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in merged staging PR #3004.