Files
HIPCTF2/docs/guides/event-window.md
T

1.6 KiB

type, title, description, tags, timestamp
type title description tags timestamp
guide Event Window How the live event countdown is computed and surfaced via REST + SSE.
guide
event
countdown
sse
2026-07-21T18:28:00Z

Configuration

Two setting rows control the window:

Setting key Default (seeded) Description
eventStartUtc now + 60s ISO 8601 instant the event becomes live.
eventEndUtc now + 7d ISO 8601 instant the event ends.

Both are seeded by SeedSystemData1700000000100 and editable through SettingsService.

State computation

EventStatusService.getStatus(now) (backend/src/common/services/event-status.service.ts) returns one of three branches:

Condition status countdownMs
now < eventStartUtc Stopped (countdown) eventStartUtc - now
now ∈ [start, end] Running eventEndUtc - now
now >= eventEndUtc Stopped (ended) 0

Endpoints

  • GET /api/v1/event/status — one-shot read (see System Endpoints).
  • GET /api/v1/event/stream — SSE stream that pushes the same payload whenever SseHubService.publish() is called (typically by an admin cron tick). The SPA subscribes to keep the countdown ticking without polling.

See also