Skip to content

Real-Time Conflict-Free Scoring on League Night

On league night, two team captains often score the same match simultaneously on separate mobile devices. Here is how LeagueMaster delivers instant updates while preventing data corruption.


Unlike recreational apps where a single scorekeeper controls the sheet, competitive pool requires mutual verification:

  1. Both Home and Away scorekeepers track the current rack independently.
  2. If both devices submit matching rack scores (e.g., Player A pockets the 8-ball in inning 3), the rack transitions to Verified.
  3. If an input discrepancy occurs (e.g. one captain records 3 innings while the other records 4), the specific field is marked in amber.

Firestore Optimistic Concurrency & Transactions

Section titled “Firestore Optimistic Concurrency & Transactions”

To guarantee atomic updates across concurrent mobile devices:

  • Every TeamMatchModel contains an integer version field.
  • When submitting the final approved score sheet, ScheduleRepository.saveTeamMatchWithConflictResolution() runs within a Firestore transaction.
  • If another device modified the score sheet concurrently, the transaction aborts cleanly, fetches the latest delta, and prompts the user to resolve the difference before overwriting.