mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2107] Game background runtime media state should be scoped by game id #1027
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#1027
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/2107
Originally assigned to: @Promansis on GitHub.
Summary
Game runtime media state is scoped by
activeChatIdonly in the refactor UI. Legacy scoped scene media/background state byactiveChatId:gameId, so replacing or starting a different game under the same chat could clear stale scene media correctly.Expected behavior
When a game is replaced or a different game/session identity is active under the same chat, scene background/media runtime state should reset or restore against the current game identity. Last resolved backgrounds, current scene background, music/ambient state, pending scene readiness, and restored-scene flags should not leak across game identities.
Actual behavior
Current refactor
GameSurfaceresets runtime media/background state and caches the last resolved background byactiveChatIdonly. A same-chat game replacement can keep stale scene media/background state longer than legacy because the game id/session boundary is not part of the scope key.Steps to reproduce
gameIdchanges whileactiveChatIdstays the same.Impact area
Environment
refactor, parityscan on 2026-06-04Logs, screenshots, or video
No runtime logs or screenshots. Static parity evidence only.
Refactor evidence:
src/features/modes/game/components/GameSurface.tsxusesprevActiveChatRefand resets runtime state only whenactiveChatIdchanges.src/features/modes/game/components/GameSurface.tsxstoreslastResolvedBackgroundRefas{ chatId, url }and updates/clears it againstactiveChatId.Legacy evidence:
main:packages/client/src/components/game/GameSurface.tsxdefinesactiveGameMetaIdfromchatMeta.gameId.main:packages/client/src/components/game/GameSurface.tsxdefinessceneRuntimeScopeKey = ${activeChatId}:${activeGameMetaId}.sceneRuntimeScopeKey, including runtime reset, media reset, restored-scene reset, and last resolved background cache.Regression notes
Legacy
mainscoped game scene media/background runtime state by both chat id and game id. Refactor currently scopes this part by chat id only, so this is a parity regression found during target 4 media/assets rescan.Additional context
Related tracker: #2106,
04-MA-RUNTIME-game-background-resolution.Suggested fix path:
GameSurface, such as${activeChatId}:${chatMeta.gameId ?? ""}or another explicit per-game/session identity.04-MA-RUNTIME-game-background-resolutionafter the fix.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: