Skip to content

fix(game): don't freeze group games when the next player has blackjack - #115

Merged
d-Rickyy-b merged 1 commit into
masterfrom
claude/project-thread-gbpez2
Oct 8, 2026
Merged

d-Rickyy-b merged 1 commit into
masterfrom
claude/project-thread-gbpez2

Conversation

@d-Rickyy-b

Copy link
Copy Markdown
Owner

Requested by Rico · project thread

Before: in a group game, the game could freeze when one player pressed Stand (or busted) and the next player had been dealt a blackjack. The bot posted the next player's cards without buttons and answered the person who pressed the button with "It's not your turn". After that nobody could continue until the stale-game cleaner removed the game.

After: the player with the blackjack is skipped automatically and play moves on to the next player, or to the dealer.

The automatic skip in players_turn called next_player(), which checks that the user who triggered the update is the current player. During an auto-skip, the triggering user is the previous player, so that check always failed.

How: the turn-advancing logic now lives in _advance_turn(), which runs no permission check. players_turn uses it for automatic skips. next_player() keeps the "is it your turn?" check for real button presses and then calls _advance_turn(). I added a regression test (test_next_player_skips_player_with_blackjack). It fails without the fix and passes with it, and the full suite passes on Python 3.11.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KouGQtM6VBedfBdNr8WFX5


Generated by Claude Code

…ackjack

When a player's turn ended and the next player had been dealt a natural
21, players_turn called next_player() again. That re-ran the "is it your
turn?" check against the user who pressed the button, which failed, so
the skip never happened and the game was stuck without a keyboard.

Split the turn advancement into _advance_turn(), which players_turn uses
for automatic skips, and keep the permission check in next_player() for
button presses only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KouGQtM6VBedfBdNr8WFX5
@d-Rickyy-b d-Rickyy-b self-assigned this Oct 8, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 67.395% (+4.2%) from 63.194% — claude/project-thread-gbpez2 into master

@d-Rickyy-b
d-Rickyy-b merged commit 997d655 into master Oct 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants