mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1503] Roleplay weather effects can leak world state across chats #755
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#755
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/1503
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Roleplay weather effects read the global world-state store directly instead of the chat-scoped tracker controller, so weather/time visuals can leak from another chat.
This came out of the Roleplay smoke/audit work for #1486.
Evidence
src/features/modes/roleplay/components/ChatRoleplaySurface.tsxdefinesWeatherEffectsConnectedas:const gs = useGameStateStore((s) => s.current);<WeatherEffects weather={gs?.weather ?? null} timeOfDay={gs?.time ?? null} />.useTrackerStateController(chatId, ...), which guards reads withs.current?.chatId === activeChatIdand loads the target chat's world state.WeatherEffectsConnectedreceives nochatIdand does not verify thatuseGameStateStore.current.chatIdmatches the active Roleplay chat.ChatRoleplaySurfacerenders weather effects independently of tracker widgets:{weatherEffects && addonsReady && <WeatherEffectsConnected />}.Expected
Weather/time visuals should be scoped to the active Roleplay chat. Switching to a chat with no tracker state should clear weather effects instead of showing the previous chat's weather.
Actual
The weather overlay can render whatever happens to be in the global world-state store, even if that state belongs to a different chat. This is especially likely when weather effects are enabled but tracker widgets/controller are disabled or still loading for the active chat.
Suggested Fix
Route weather effects through the same chat-scoped state contract as the HUD/tracker panel. Options:
chatIdintoWeatherEffectsConnectedand only usecurrentwhencurrent.chatId === chatId, oruseTrackerStateController(chatId, ...)or an equivalent scoped world-state hook.Avoid a UI-only fallback that keeps stale global state visible.
Related
@SpicyMarinara commented on GitHub (May 29, 2026):
Addressed in
b2cebc28on refactor. Weather effects now receive the active Roleplay chat id and only read world-state data when the store's current chat id matches, so switching chats clears stale weather/time visuals instead of leaking another chat's tracker state. Added the Graphify refresh for the changed files.