Skip to content

Fix post-start tournament corruption paths - #24

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

Fix post-start tournament corruption paths#24
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-8c53

Conversation

@cursor

@cursor cursor Bot commented May 29, 2026

Copy link
Copy Markdown

Bug and impact

  • Post-start deleteGuestPlayer could dissolve a team that already had classification/category matches, leaving persisted matches pointing at a deleted team.
  • Post-start group rebalancing and direct groupIndex PATCHes could rewrite team group placement without regenerating classification fixtures, desynchronizing standings/fixtures from persisted matches.
  • Correcting a completed knockout winner could reset an intermediate match while later matches still consumed that intermediate match's stale winner.

Root cause

  • UI-level locks were not mirrored by server guards for single guest deletion, rebalance, or team group changes.
  • Bracket recompute built winner/loser maps from the pre-reset match snapshot and did not cascade invalidation to descendants of reset matches.

Fix

  • Block single guest deletion and team group changes after tournament start.
  • Make group rebalancing reject started tournaments and any tournament with in-progress/completed matches.
  • Cascade knockout recompute resets so descendants of reset matches clear dependent slots instead of using stale winners.
  • Added focused regression tests for rebalance guards and knockout cascade behavior.

Validation

  • npm test -- --run tests/criticalTournamentMutations.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 29, 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 29, 2026 10:44am

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