Paper Dynasty Discord - Discord bot for card game
CRITICAL BUG FIX: Play locks were never released on exceptions, causing permanent user lockouts. Found 13 stuck plays in production. Changes: 1. Added lock_play parameter to checks_log_interaction() (default True) 2. Removed unnecessary locks from read-only commands: - /settings-ingame (game settings, not play state) - /show-card defense (read-only display) - /substitute commands (just show UI, lock in callback) 3. Added safe_play_lock() context manager for automatic lock release 4. Added play locking to substitution callbacks: - SelectBatterSub.callback() - SelectReliefPitcher.callback() 5. Global error handler now releases stuck locks automatically Architecture: - Commands that display UI or read data: No lock - Commands that modify play state: Lock at last possible moment - 3-layer defense: manual release, context manager, global handler Resolves race condition from concurrent play modifications. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .plans | ||
| .vscode | ||
| cogs | ||
| command_logic | ||
| discord_ui | ||
| helpers | ||
| in_game | ||
| migrations | ||
| tests | ||
| utilities | ||
| .dockerignore | ||
| .gitignore | ||
| alembic.ini | ||
| api_calls.py | ||
| constants.py | ||
| db_calls_gameplay.py | ||
| deploy.sh | ||
| DEPLOYMENT.md | ||
| dice.py | ||
| discord_utils.py | ||
| Dockerfile | ||
| exceptions.py | ||
| gauntlets.py | ||
| health_server.py | ||
| help_text.py | ||
| helpers.py | ||
| LICENSE | ||
| manual_pack_distribution.py | ||
| notify_restart.py | ||
| paperdynasty.py | ||
| PRODUCTION_COGS.md | ||
| pytest.ini | ||
| random_content.py | ||
| requirements.txt | ||
| search_utils.py | ||
| utils.py | ||
| VERSION | ||