15 Commits

Author SHA1 Message Date
cottongin
d314193540 Fix stale cmd/ scripts, export LoginWithChromedp, clean up vet warnings
Update 5 cmd/ test utilities that referenced APIs that drifted after
bridge refactors (NewBrowserAuthManager, bridge.NewConfig, changed
function signatures). Rewrite test-kosmi and test-native to use
NewGraphQLWSClient directly. Export LoginWithChromedp for use by cmd
scripts. Fix redundant-newline vet warnings across 5 cmd/ files.
Remove unreachable code and replace deprecated ioutil calls in
bridge/helper/lottie_convert.go.

Made-with: Cursor
2026-04-05 05:49:26 -04:00
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
fd42ac0e7c working state 2026-02-07 12:37:21 -05:00
cottongin
1e0cb63b1c tweaks to websocket 2026-02-07 00:06:20 -05:00
cottongin
673c8025ee nailed it 2.0 2025-11-02 16:49:12 -05:00
cottongin
9262ae79dd nailed it 2025-11-02 16:48:18 -05:00
cottongin
f764519a30 nailed it 2025-11-02 16:04:03 -05:00
cottongin
dd398c9a8c sync 2025-11-01 21:00:16 -04:00
cottongin
bd9513b86c wow that took awhile 2025-11-01 10:40:53 -04:00
cottongin
9143a0bc60 here goes 2025-10-31 23:56:16 -04:00
cottongin
3116721256 minor tweak 2025-10-31 21:41:27 -04:00
cottongin
c63c29efc9 proof-of-concept worked. rolling into main 2025-10-31 20:38:38 -04:00
cottongin
020daea391 working v1 2025-10-31 16:17:04 -04:00