Skip to content

Mark unplayed games Full Time when a result is entered manually - #51

Merged
ylynfatt merged 1 commit into
mainfrom
manual-result-full-time
Jul 19, 2026
Merged

ylynfatt merged 1 commit into
mainfrom
manual-result-full-time

Conversation

@ylynfatt

Copy link
Copy Markdown
Owner

Summary

Fixes a two-entry-paths inconsistency surfaced while reviewing the knockout seeding warning (#50): the manual result editor recorded the score but never touched the game's status, so played games sat at scheduled forever. Standings looked fine (they read results), but everything keyed off a final status silently misbehaved:

  • AdvanceBracketWinner never promoted winners for manually-entered knockout results
  • the seeding card's "group stage not finished" warning stayed amber even with all 72 results in (68 of 72 dev World Cup group games were scheduled with results attached)

Changes

  • storeResult promotes scheduled/postponed games to Full Time before saving the result, so the observer chain sees a final game and bracket advancement fires. Live/half-time/cancelled games are untouched — the editor is a correction tool there, not a way to end a match.
  • One-off backfill migration sets full_time on already-recorded games (query builder on purpose: no broadcasts / advancement side-effects mid-migration). Irreversible by design.

Independent of #49/#50 — branched off main, can merge in any order.

Testing

  • 7 new feature tests: scheduled→FullTime and postponed→FullTime on entry, live/half-time/cancelled untouched (dataset), bracket winner advancement end-to-end via the manual endpoint, and the backfill's selectivity (result+scheduled → full_time; no-result and live games untouched)
  • Full suite: 406 passed
  • Backfill verified on dev data: all 72 World Cup group games now full_time

🤖 Generated with Claude Code

Recording a result through the manual editor left the game's status
untouched, so played games sat at scheduled forever. Standings still
looked right (they read results), but everything keyed off a final
status silently misbehaved: bracket winners never advanced for
manually-entered knockout results, and the knockout seeding card warned
that the group stage was unfinished even with every result in.

- storeResult now promotes scheduled/postponed games to Full Time
  before saving the result, so observers (bracket advancement,
  completeness checks) see a final game; in-progress games are left
  alone — the editor is a correction tool there
- one-off migration backfills full_time onto already-recorded games,
  via the query builder so no broadcasts or advancement fire mid-migration

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ylynfatt
ylynfatt merged commit 2ccf30b into main Jul 19, 2026
1 check passed
@ylynfatt
ylynfatt deleted the manual-result-full-time branch July 19, 2026 20:33
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