Skip to content

Events: a warp no longer makes a late poll answer raise the Chaos Castle prompt - #524

Open
openmubr wants to merge 1 commit into
Ignies:mainfrom
openmubr:pr/schedule-warp-poll
Open

openmubr wants to merge 1 commit into
Ignies:mainfrom
openmubr:pr/schedule-warp-poll

Conversation

@openmubr

@openmubr openmubr commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After changing map, the "After N minutes you may enter Chaos Castle." prompt sometimes popped up on its own.

Cause

schedule.ts polls MiniGameOpeningState for the event HUD rows and sets sentAtMs, so that takeOpeningState recognises the answer as its own and the Blood/Devil/Chaos handlers show nothing. The layer's reset(), called on every map change, cleared sentAtMs. Loading the map blocks the main thread, so the answer to a poll sent just before the warp is only handled after the reset. It was then taken for the answer to a ticket click and the Chaos Castle handler opened its prompt.

Fix

reset() leaves sentAtMs alone. A request that is never answered still expires after ANSWER_TIMEOUT_MS, and the 30 s request floor is unchanged.

Tests

src/modules/events/scheduleWarp.test.ts: poll, reset(), then the answer arrives; no prompt is raised (fails without the change). A second case checks that an answer nobody asked for still raises the prompt, so the ticket path is untouched. All 42 tests in src/modules/events pass.

🤖 Generated with Claude Code

@openmubr
openmubr requested a review from Ignies as a code owner November 13, 2026 22:50
schedule.ts polls MiniGameOpeningState for the HUD rows and sets `sentAtMs` so that
`takeOpeningState` treats the answer as its own and shows nothing. The layer's `reset()`
(called on every map change) cleared `sentAtMs`. Loading the map blocks the main thread,
so the answer to a poll sent just before the warp is only handled after the reset; it was
then taken for a ticket's answer and the "After N minutes you may enter Chaos Castle."
prompt popped up on its own.

`reset()` now leaves `sentAtMs` alone (an unanswered request already expires after
ANSWER_TIMEOUT_MS). Test added: it fails without the change.
@openmubr
openmubr force-pushed the pr/schedule-warp-poll branch from 4413753 to 73c35c5 Compare November 13, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant