paper-dynasty-discord/cogs
Cal Corum ebf006e5c6 Fix play lock system to prevent permanent user lockouts
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>
2026-02-04 09:21:18 -06:00
..
economy_new Fix pack type grouping logic in packs display 2026-01-08 14:22:06 -06:00
players_new CLAUDE: Add news-ticker message when gauntlet runs end with 2 losses 2025-11-10 09:17:55 -06:00
admins.py Catchup commit 2025-07-22 09:22:19 -05:00
economy.py Normalize Player.franchise queries to use Team.sname 2026-01-07 12:01:00 -06:00
gameplay_legacy.py Add responders check to dropdowns 2024-12-27 22:33:25 -06:00
gameplay.py Fix play lock system to prevent permanent user lockouts 2026-02-04 09:21:18 -06:00
owner.py New sync method 2024-12-18 09:59:39 -06:00
players.py Fix slash command decorators using wrong prefix command checks 2025-11-17 07:29:08 -06:00
players.py.backup Cogs to Packages Groundwork 2025-08-17 08:46:55 -05:00