-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Open
Labels
High ValueMeaningful contribution to the projectMeaningful contribution to the projectenhancementNew feature or requestNew feature or request
Description
Summary
Upgrade from HTTP polling to Server-Sent Events (SSE) for real-time push of breaking news, alerts, and data updates to the browser.
Current State
All browser-to-backend communication uses HTTP polling via SmartPollLoop:
- Telegram Intel: 60s polling
- OREF Alerts: 120s polling
- RSS News: 15min polling
- AIS Vessels: 5min polling (WebSocket upstream exists on Railway relay, but frontend polls HTTP)
Proposed Architecture
Railway relay ──SSE──→ Browser
- Breaking news alerts (instant push)
- OREF alerts (instant push)
- AIS position updates (near real-time)
- Telegram intel (reduced latency)
Why SSE over WebSocket
- Unidirectional (server→client) is sufficient
- HTTP compatible (works with Vercel Edge)
- Native
EventSourceAPI in browsers - Auto-reconnect built in
Priority
Deferred — current polling intervals are acceptable for MVP. Real-time push becomes important when:
- User count increases (polling doesn't scale)
- Breaking news latency matters (15min RSS delay is too slow)
- AIS tracking needs sub-minute updates
Related
- Design discussion in session 2026-03-07
- SmartPollLoop in
src/services/runtime.ts - Railway relay in
scripts/ais-relay.cjs - Breaking news events:
wm:breaking-newsCustomEvent pattern already exists
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
High ValueMeaningful contribution to the projectMeaningful contribution to the projectenhancementNew feature or requestNew feature or request