Remove dead finish_game; use guarded finish_and_enqueue#16
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What & why
Db::finish_gamewas an un-guarded, non-transactional writer that set a game tostatus='finished'directly. It had no production caller — only twoDATABASE_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')) thatfinish_and_enqueuenow enforces — exactly the double-settle class we just closed in #15.Change
finish_game.finish_and_enqueue(..., None, false)(the games are unwagered, sowinner_addr=None,wagered=false) — now the tests exercise the same path production uses.Verification
finish_gamereferences remain; full Rust suite green. The two touched tests are DB-gated (skip locally, run under CI Postgres) and behave identically —finish_and_enqueuewrites the samestatus/result/reason/hash/pgnfields; unwagered means no outbox row.🤖 Generated with Claude Code