golfgame/server
Aaron D. Lee f27020f21b Fix V2 race conditions, auth gaps, serialization bugs, and async stats
Phase 1 - Critical Fixes:
- Add game_lock (asyncio.Lock) to Room class for serializing mutations
- Wrap all game action handlers in lock to prevent race conditions
- Split Card.to_dict into to_dict (full data) and to_client_dict (hidden)
- Fix CardState.from_dict to handle missing rank/suit gracefully
- Fix GameOptions reconstruction in recovery_service (dict -> object)
- Extend state cache TTL from 4h to 24h, add touch_game method

Phase 2 - Security:
- Add optional WebSocket authentication via token query param
- Use authenticated user ID/name when available
- Add auth support to spectator WebSocket endpoint

Phase 3 - Performance:
- Make stats processing async (fire-and-forget) to avoid blocking
  game completion notifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:27:30 -05:00
..
middleware Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
models Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
routers Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
scripts Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
services Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
stores Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
tests Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
.env.example Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
ai.py Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
auth.py Numerous WebUI animations, improvements, AI fixes, opporitunity cost-based decision logic, etc. 2026-01-25 17:37:01 -05:00
config.py Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
constants.py Additional house rules to accomodate more common game variants. 2026-01-26 20:13:30 -05:00
game_analyzer.py Refactor card values to single source of truth, fix ten_penny bug 2026-01-24 20:26:17 -05:00
game_log.py Additional flip on discard variant - endgame and updated rules.md and new rules page. 2026-01-26 01:01:08 -05:00
game.py Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
games.db More host UI refinements, fun logo animations, etc. 2026-01-26 17:03:30 -05:00
logging_config.py Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
main.py Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
requirements.txt Huge v2 uplift, now deployable with real user management and tooling! 2026-01-27 11:32:15 -05:00
room.py Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
RULES.md Early Knock house rule and improved error handling. 2026-01-26 22:23:12 -05:00
score_analysis.py Additional flip on discard variant - endgame and updated rules.md and new rules page. 2026-01-26 01:01:08 -05:00
score_distribution.png Numerous WebUI animations, improvements, AI fixes, opporitunity cost-based decision logic, etc. 2026-01-25 17:37:01 -05:00
simulate.py Additional flip on discard variant - endgame and updated rules.md and new rules page. 2026-01-26 01:01:08 -05:00
test_analyzer.py Numerous WebUI animations, improvements, AI fixes, opporitunity cost-based decision logic, etc. 2026-01-25 17:37:01 -05:00
test_auth.py Numerous WebUI animations, improvements, AI fixes, opporitunity cost-based decision logic, etc. 2026-01-25 17:37:01 -05:00
test_game.py Fix V2 race conditions, auth gaps, serialization bugs, and async stats 2026-01-27 16:27:30 -05:00
test_house_rules.py Additional flip on discard variant - endgame and updated rules.md and new rules page. 2026-01-26 01:01:08 -05:00
test_maya_bug.py Numerous WebUI animations, improvements, AI fixes, opporitunity cost-based decision logic, etc. 2026-01-25 17:37:01 -05:00