Skip to content

Fix category bracket resets and started-tournament mutation guards - #21

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-correctness-bugs-7279
Draft

Fix category bracket resets and started-tournament mutation guards#21
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-correctness-bugs-7279

Conversation

@cursor

@cursor cursor Bot commented May 26, 2026

Copy link
Copy Markdown

Bug and impact

  • Editing a completed upstream category knockout match could reset the immediate downstream match but leave later completed matches with stale teams, scores, and winners.
  • Started tournaments still allowed guest deletion/group reassignment paths that could dissolve teams or rewrite group membership after matches existed, corrupting fixtures/standings.

Root cause

  • Bracket recomputation used a one-time winner snapshot and did not treat matches reset in the same pass as pending feeders.
  • Guest delete, group rebalance, and team group PATCH paths were missing started-tournament guards.

Fix

  • Recompute category bracket dependencies until downstream slots stabilize, clearing scores/winners for every invalidated match.
  • Block guest deletion, group rebalance, and team group changes once a tournament has started; hide guest delete controls after start.
  • Return a 400 for rejected rebalance attempts instead of falling through to a server error.

Validation

  • npm test -- --run tests/knockoutAdvance.test.ts tests/rebalanceTournamentTeams.test.ts
  • npm test
  • npm run typecheck
  • npm run lint (passes with existing warnings)
  • npm run vercel:functions
Open in Web View Automation 

cursoragent and others added 3 commits May 26, 2026 10:07
Co-authored-by: Octavio Frangipani <octapf@users.noreply.github.com>
Co-authored-by: Octavio Frangipani <octapf@users.noreply.github.com>
Co-authored-by: Octavio Frangipani <octapf@users.noreply.github.com>
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
matchpoint Canceled Canceled May 26, 2026 11:14am

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