Skip to content

Fix critical tournament bracket and roster corruption paths - #16

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-identification-03a5
Draft

Fix critical tournament bracket and roster corruption paths#16
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-identification-03a5

Conversation

@cursor

@cursor cursor Bot commented May 20, 2026

Copy link
Copy Markdown

Bug and impact

  • Editing the winner of a completed upstream category match only reset directly affected matches, leaving deeper completed finals/bronze matches with stale teams and winners.
  • Post-start guest deletion and team creation could mutate rosters after fixtures existed, orphaning live matches or creating teams with no matches.
  • Multi-division waitlist promotion/rebalance could assign teams into another division's global group slice, causing wrong classification fixtures/category progression.

Root cause

  • Bracket recompute used a single snapshot pass and did not transitively invalidate downstream dependencies.
  • Destructive roster APIs were missing post-start guards.
  • Group assignment helpers scanned/rebalanced global group indices without constraining them to the team's division slice.

Fix

  • Propagate category bracket invalidation through all downstream feeder dependencies and clear stale slots from invalidated matches.
  • Reject post-start team creation and guest deletion, and hide the guest delete action after start.
  • Make waitlist promotion and group rebalancing division-slice aware; block rebalance after the tournament or any match has started; use mixed string/ObjectId tournament filters for status/group operations.

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 20, 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 20, 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