Repository navigation
Fix gameplay bugs, add real tests, update gems and CI - #25
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Games could not finish: the game-over broadcast rendered
_game_overwithout theplayerlocal, 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.04becauseubuntu-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