Skip to content

Fix tournament roster and serve-order corruption guards - #3

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

Fix tournament roster and serve-order corruption guards#3
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-inspection-f4d5

Conversation

@cursor

@cursor cursor Bot commented May 4, 2026

Copy link
Copy Markdown

Bug and impact

  • Post-start group rebalancing and guest roster mutations could alter team/group assignments after matches already existed, leaving fixtures and standings inconsistent with persisted tournament state.
  • setServeOrder accepted arbitrary player IDs/slots and scoring assumed Team A always occupied even serve slots, which could corrupt serving state or rotate the server incorrectly when Team B starts.

Root cause

  • Some roster/group mutation paths missed the same started-tournament lock used elsewhere.
  • Serve-order writes only checked array length, and point scoring derived serving side from index parity instead of the validated serve order.

Fix

  • Block group rebalance and guest create/update/delete after a tournament has started.
  • Add shared serve-order validation/default helpers, validate setServeOrder against the two match rosters, and use the configured order to determine serving side during point updates.
  • Avoid rendering/tapping incomplete serve-order rows in the match UI.

Validation

  • Added focused Vitest coverage for serve-order validation and serving-side derivation.
  • Could not execute tests in this container because Node/npm are not available on PATH.
Open in Web View Automation 

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

vercel Bot commented May 4, 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 4, 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