Skip to content

Fix gameplay bugs, add real tests, update gems and CI - #25

Merged
jbutton merged 1 commit into
mainfrom
tidy/fix-gameplay-and-ci
Nov 12, 2026
Merged

jbutton merged 1 commit into
mainfrom
tidy/fix-gameplay-and-ci

Conversation

@jbutton

@jbutton jbutton commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Games could not finish: the game-over broadcast rendered _game_over without the player local, so the winning shot raised and rolled back. That's fixed along with a self-matchmaking bug, the lobby after a finished game, and missing ship rotation.

Also adds access checks (only the two players can view a game or fire in it, only a board's owner can place ships on it), replaces the broken generated tests with 48 real ones, removes generator leftovers, updates gems to clear bundler-audit (Rails 8.1.4.1), and pins CI to ubuntu-24.04 because ubuntu-latest (26.04) has no Ruby 3.4.7 and every job was failing at setup.

Locally: tests, RuboCop, Brakeman, bundler-audit and importmap audit all pass. The new rotation and placement JS is syntax-checked but not yet clicked through in a browser.

🤖 Generated with Claude Code

Gameplay
- Game over broadcast rendered _game_over without the player local and
  on a stream nobody subscribed to, so the winning shot raised and rolled
  back: games could never finish. Broadcast per player instead.
- Matchmaking could pair a player with their own waiting game (e.g.
  clicking "Find Opponent" twice). Reuse the unfinished game instead.
- Lobby kept showing a finished game instead of offering a new match.
- Ship placement now supports rotation (button or R key) and renders the
  server's Turbo Stream response, so the waiting screen appears.
- Consolidate broadcasts on the single player_<id> stream.

Access control
- Only the two players can view a game or fire in it.
- Only a board's owner can place ships on it.

Cleanup
- Remove the generator-stub views, empty helpers, hello controller, the
  unused games#fire action/route and a debug console.log.

Tests
- Replace the broken generated tests and fixtures with 48 tests covering
  board rules, services, the auto-placement job and request specs.

Dependencies and CI
- bundle update: Rails 8.1.4.1 and others; bundler-audit is now clean.
- Pin CI runners to ubuntu-24.04: ubuntu-latest (26.04) has no prebuilt
  Ruby 3.4.7, which failed every job at setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jbutton
jbutton merged commit 564745a into main Nov 12, 2026
5 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.

1 participant