Skip to content

Fix cascading category bracket invalidation - #1

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-inspection-0002
Draft

Fix cascading category bracket invalidation#1
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-inspection-0002

Conversation

@cursor

@cursor cursor Bot commented May 1, 2026

Copy link
Copy Markdown

Bug and impact

Editing the winner of a completed category bracket match only reset immediate dependent matches. If later rounds had already been completed, downstream matches could remain completed with stale teams/winners from the old branch, corrupting the published bracket state.

Root cause

recomputeCategoryBracketAfterWinnerChange recomputed each match once from the pre-edit winner map. Matches fed by a reset downstream match did not see that dependency as invalidated, so their completed scores and winners could survive even though their slot was no longer known.

Fix

Track invalidated matches while recomputing category slots and cascade that invalidation through winner/loser feeds. Any match whose feeder was reset now has its affected slot cleared and score/referee/completion fields removed.

Validation

  • Added focused regression coverage in tests/knockoutAdvance.test.ts for a stale final after a changed upstream winner.
  • Attempted npm test -- tests/knockoutAdvance.test.ts and npm run typecheck, but this cloud image has no npm/Node tooling on PATH.
Open in Web View Automation 

Co-authored-by: Octavio Frangipani <octapf@users.noreply.github.com>
@vercel

vercel Bot commented May 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
matchpoint Ready Ready Preview, Comment May 1, 2026 10:39am

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