Skip to content

1118 bug match start confirmations can overwrite each other - #1124

Open
tickBit wants to merge 3 commits into
devfrom
1118-bug-match-start-confirmations-can-overwrite-each-other
Open

tickBit wants to merge 3 commits into
devfrom
1118-bug-match-start-confirmations-can-overwrite-each-other

Conversation

@tickBit

@tickBit tickBit commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Brief description

Fixes a race condition in match-start readiness confirmations. Concurrent requests now retain every player confirmation and trigger the match-start event exactly once.

Change list

  • Use an atomic Redis compare-and-set operation when updating match readiness.
  • Retry the update when another request modifies the match concurrently.
  • Set battleStartedAt only once after all human players are ready.
  • Publish MATCH_STARTED only from the request that starts the battle.
  • Keep repeated readiness requests idempotent.
  • Add concurrent tests for 1v1, 2v2, and duplicate player confirmations.

@codecov-alt

codecov-alt Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/matchmaking/matchmaking.service.ts 92.96% <100.00%> (-0.19%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Bug: Match start confirmations can overwrite each other

1 participant