Skip to content

Fix started tournament roster guards and bracket invalidation - #23

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

Fix started tournament roster guards and bracket invalidation#23
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-f73f

Conversation

@cursor

@cursor cursor Bot commented May 28, 2026

Copy link
Copy Markdown

Bug and impact

  • Editing an already-completed category knockout match could leave transitive downstream matches completed with stale teams/scores, corrupting brackets after a winner change.
  • Started tournaments still allowed guest deletion, new team creation, group reassignment, and group rebalancing through server routes, which could desync teams from already-generated matches and corrupt live standings/brackets.

Root cause

  • recomputeCategoryBracketAfterWinnerChange used a single pre-reset snapshot, so grandchildren of a changed feeder could keep stale completed outcomes.
  • Several server-side mutation paths did not consistently enforce the existing started-tournament lock used by neighboring roster/group operations.

Fix

  • Transitively invalidate all category matches downstream of an edited winner, reset them, and clear slots fed by invalidated matches.
  • Reject post-start guest deletion, team creation, team group changes, and group rebalancing at the server layer.
  • Added focused regression tests for transitive bracket invalidation and the rebalance started-state guard.

Validation

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

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

vercel Bot commented May 28, 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 28, 2026 10:42am

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