Skip to content

Fix live tournament roster structure mutation guards - #12

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-b436
Draft

Fix live tournament roster structure mutation guards#12
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-b436

Conversation

@cursor

@cursor cursor Bot commented May 16, 2026

Copy link
Copy Markdown

Bug and impact

  • Organizers could PATCH a team's groupIndex after the tournament had started, moving teams between groups while fixtures, standings, and bracket state still referenced the original group assignments.
  • Organizers could delete a single guest player after start; when that guest was on a team, the delete path dissolved the team, leaving live matches/brackets with orphaned team references.

Root cause

  • Team PATCH only locked name and roster fields after start, not groupIndex.
  • deleteGuestPlayer lacked the started-tournament guard already present on bulk guest deletion and other roster-removal paths.

Fix

  • Reuse the shared started-tournament predicate in team PATCH and reject group changes after start.
  • Add the same started-tournament guard to single guest deletion before it can dissolve a team.
  • Add regression tests for both live mutation guards.

Validation

  • npm test -- tests/liveMutationGuards.test.ts
  • npm test
  • npm run typecheck
  • npm run lint
Open in Web View Automation 

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

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

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