Commit Graph

5 Commits

Author SHA1 Message Date
cottongin
4fc7f08b24 Add connection resilience and reconnect commands for Kosmi and Jackbox
Kosmi WebSocket would silently die after hours/days with no reconnection.
Jackbox WebSocket failed to reconnect after API server restarts (stale JWT)
and leaked heartbeat goroutines on each reconnect cycle.

Kosmi changes:
- Add WebSocket ping/pong keepalive (30s ping, 90s read deadline)
- Send EventFailure on unexpected disconnect to trigger gateway reconnectBridge()
- Add intentionalDisconnect flag to prevent false failure events on clean shutdown
- Fix Disconnect() to be safe for reconnect cycles

Jackbox changes:
- Add read deadline (90s) to detect stale connections
- Fix heartbeat goroutine leak via per-connection listenDone channel
- Re-authenticate for fresh JWT before each reconnect attempt
- Add Manager.Reconnect() for on-demand teardown and rebuild

IRC commands:
- !kreconnect - reconnect Kosmi bridge
- !jreconnect - reconnect Jackbox WebSocket
- !reconnect  - reconnect all services (Kosmi + Jackbox)

Made-with: Cursor
2026-04-05 05:30:39 -04:00
cottongin
bec3615d2b Add ticker symbol voting (e.g. QPL3++, TMP2--)
Extend vote detection to recognize game ticker symbols alongside the
existing thisgame++/-- syntax. Each symbol maps to a specific game so
users can vote for any game by its stock-style ticker. The matched
ticker is sent to the API via a new optional `ticker` field in the
vote request.

Made-with: Cursor
2026-04-05 04:54:05 -04:00
cottongin
88cc140087 Add !votes command, fix vote tally timing, and improve Kosmi stability
- Add !votes command (IRC + Kosmi) showing per-session and all-time vote
  breakdowns for the current game via new Jackbox API endpoints
  (GET sessions/{id}/games, sessions/{id}/votes, games/{id})
- Fix vote tally broadcasting: remove debounce timer, announce tallies
  only at game transitions or session end instead of after every vote
- Add !kreconnect IRC command to manually trigger Kosmi reconnection
- Add WebSocket ping/pong keepalive and write mutex to Kosmi client
  for connection stability
- Add watchConnection() auto-reconnect on unexpected Kosmi disconnects
- Remove old 2025-10-31 chat summaries; add votes command design doc

Made-with: Cursor
2026-03-16 20:56:18 -04:00
cottongin
bd9513b86c wow that took awhile 2025-11-01 10:40:53 -04:00
cottongin
020daea391 working v1 2025-10-31 16:17:04 -04:00