Problem
The live match viewer shows no matches despite one actively playing.
GET /health
{"status":"ok","queue_size":0,"active_matches":1,"live_match_ids":[]}
active_matches comes from the DB (matches WHERE status = 'playing'), but live_match_ids comes from the in-memory _manager.match_info dict. After an arena restart (e.g. Railway redeploy), the DB retains the playing match but the WebSocket manager's in-memory state is lost.
The website uses live_match_ids to populate the viewer and the pulsing "LIVE" indicator in the header. With an empty array, both show nothing.
Root Cause
arena/server.py:863:
"live_match_ids": list(_manager.match_info.keys()),
_manager.match_info is populated only when a match_start WebSocket message arrives. If the arena restarts mid-match, this dict is empty even though the DB says a match is playing.
Suggested Fix
Fall back to the DB when _manager.match_info is empty:
live_ids = list(_manager.match_info.keys())
if not live_ids:
# Recover from restart: use DB playing matches
live_ids = db.get_playing_match_ids()
Or repopulate _manager.match_info on startup from DB state.
Impact
- Website live viewer shows "No live matches" despite match playing
- Header LIVE indicator doesn't pulse
- Spectators can't find the match
Owner: Scav (arena code)
Problem
The live match viewer shows no matches despite one actively playing.
active_matchescomes from the DB (matches WHERE status = 'playing'), butlive_match_idscomes from the in-memory_manager.match_infodict. After an arena restart (e.g. Railway redeploy), the DB retains the playing match but the WebSocket manager's in-memory state is lost.The website uses
live_match_idsto populate the viewer and the pulsing "LIVE" indicator in the header. With an empty array, both show nothing.Root Cause
arena/server.py:863:_manager.match_infois populated only when amatch_startWebSocket message arrives. If the arena restarts mid-match, this dict is empty even though the DB says a match is playing.Suggested Fix
Fall back to the DB when
_manager.match_infois empty:Or repopulate
_manager.match_infoon startup from DB state.Impact
Owner: Scav (arena code)