AI Implementation feature(905): Challenges Page and Challenge Solve Modal 1.01 (#47)
This commit was merged in pull request #47.
This commit is contained in:
@@ -3,7 +3,7 @@ type: guide
|
||||
title: Event Window
|
||||
description: How the event window state machine is computed and surfaced via REST + SSE.
|
||||
tags: [guide, event, countdown, sse, state-machine]
|
||||
timestamp: 2026-07-22T09:03:53Z
|
||||
timestamp: 2026-07-23T01:19:00Z
|
||||
---
|
||||
|
||||
# Configuration
|
||||
@@ -88,6 +88,24 @@ itself) close the SSE source and clear the tick interval, so leaving
|
||||
the shell (e.g. by logging out and landing on `/login`) tears the
|
||||
stream down cleanly.
|
||||
|
||||
# Auto-reload at the transition boundary
|
||||
|
||||
`ChallengesPage` registers a one-shot handler with
|
||||
`EventStatusStore.subscribeReloadAtCountdownZero(() => window.location.reload())`
|
||||
in its constructor; the returned disposer is wired into its
|
||||
`DestroyRef` so the subscription is cleared when the page is destroyed.
|
||||
The subscription is **page-owned** and independent of the transport
|
||||
lifecycle (`start()`/`stop()` only manage the SSE source + tick +
|
||||
watcher; they never clear the reload handler). The store owns a 1 s
|
||||
watcher (`checkZero`) that fires the handler exactly once when the
|
||||
local-clock countdown reaches zero (`countdown → running`) or the
|
||||
running countdown reaches zero (`running → stopped`). The latch is
|
||||
re-armed on every state transition (countdown→running and
|
||||
running→stopped), and a strict-equal follow-up SSE frame is collapsed
|
||||
so a duplicate zero-countdown payload cannot disarm the latch. After
|
||||
`stop()` (end-of-life teardown) the store is fully reset; a fresh
|
||||
handler subscription re-installs the watcher.
|
||||
|
||||
# Push path
|
||||
|
||||
1. The admin cron / settings update writes to `setting.eventStartUtc` /
|
||||
|
||||
Reference in New Issue
Block a user