Skip to content

Remove dead finish_game; use guarded finish_and_enqueue#16

Merged
vikramarun merged 1 commit into
mainfrom
claude/remove-dead-finish-game
Jul 12, 2026
Merged

Remove dead finish_game; use guarded finish_and_enqueue#16
vikramarun merged 1 commit into
mainfrom
claude/remove-dead-finish-game

Conversation

@vikramarun

Copy link
Copy Markdown
Owner

What & why

Db::finish_game was an un-guarded, non-transactional writer that set a game to status='finished' directly. It had no production caller — only two DATABASE_URL-gated tests used it.

Left in place it's a foot-gun: if wired into a live path it would bypass both the settlement outbox and the idempotency guard (WHERE ... AND status NOT IN ('finished','aborted')) that finish_and_enqueue now enforces — exactly the double-settle class we just closed in #15.

Change

  • Delete finish_game.
  • Repoint its two test callers at finish_and_enqueue(..., None, false) (the games are unwagered, so winner_addr=None, wagered=false) — now the tests exercise the same path production uses.

Verification

  • No finish_game references remain; full Rust suite green. The two touched tests are DB-gated (skip locally, run under CI Postgres) and behave identically — finish_and_enqueue writes the same status/result/reason/hash/pgn fields; unwagered means no outbox row.

🤖 Generated with Claude Code

finish_game was an un-guarded, non-transactional 'finished' writer with no
production caller -- only two DATABASE_URL-gated tests used it. Left in place
it was a foot-gun: wired into a live path it would bypass both the settlement
outbox and the idempotency guard (status NOT IN finished/aborted) that
finish_and_enqueue enforces. Delete it and repoint the two tests at
finish_and_enqueue (unwagered: winner_addr=None, wagered=false) -- the same
path production uses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openchess Ready Ready Preview, Comment Jul 12, 2026 4:51pm

Request Review

@vikramarun
vikramarun merged commit fab9561 into main Jul 12, 2026
3 checks passed
@vikramarun
vikramarun deleted the claude/remove-dead-finish-game branch July 17, 2026 17:21
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.

2 participants