Skip to content

Module 6: Lobby & Matchmaking System (backend) - #9

Merged
MohanEhab merged 6 commits into
mainfrom
feature/module-06-lobby-matchmaking-system
Jul 12, 2026
Merged

Module 6: Lobby & Matchmaking System (backend)#9
MohanEhab merged 6 commits into
mainfrom
feature/module-06-lobby-matchmaking-system

Conversation

@MohanEhab

Copy link
Copy Markdown
Contributor

Summary

  • Adds the Lobby and Matchmaking domain, application, and infrastructure layers: lobby lifecycle/credentials/host-transfer, matchmaking tickets/bands/coordinator, a transactional outbox pattern, game capability profile seeding, and background workers (LobbyExpiryWorker, MatchmakingWorker, OutboxDispatcherWorker).
  • Ships as a documented foundation PR: Module 8 (match runtime) is not built yet, so IMatchRuntimeProbe gates Start/Quick-Match and the only reachable outcome today is MatchRuntimeUnavailable. Matches are not playable yet.

What changed

  • src/SimPle.Domain/{Lobbies,Matchmaking,Capabilities} — new aggregates/entities
  • EF Core migration 20260711195731_AddLobbyMatchmakingAndCapabilities (additive, applied cleanly to real Postgres)
  • src/SimPle.Application/{Lobbies,Matchmaking,Outbox,Expiry} — services, DTOs, outbox handlers
  • src/SimPle.Infrastructure — repositories, background workers, capability seeding
  • src/SimPle.Api/Controllers/{Lobbies,Matchmaking,MatchRematch}Controller.cs — API endpoints
  • tests/SimPle.UnitTests, tests/SimPle.IntegrationTests — new coverage including Postgres-backed concurrency and migration smoke tests

Tests

  • Unit: 862/862 passed
  • Integration: 375/375 passed against real PostgreSQL, 0 skipped
  • dotnet ef database update: migration applied cleanly

Security/docs

  • Backend-phase ASVS-lite audit: CLOSED, zero unwaived Critical/High/Medium. 2 Low findings + 5 Info findings open, non-blocking (see SimPle.Project audit doc).
  • Module docs (api-reference, technical-flow, testing-report) shipped in the companion SimPle.Project PR.

Risks/deferred

  • Blocking dependency: Module 8 match runtime not yet built — Start/Quick-Match are dormant behind IMatchRuntimeProbe until Module 8 registers a runtime.
  • Operations gate: releaseEligible: false — no CI/staging/deployment yet, expected until Module 14's shared CI/container/staging foundation.
  • 2 Low + 5 Info security findings remain open (non-blocking).

…lity domain models

Adds the Lobby aggregate (members, invites, join credentials, settings,
outcomes), matchmaking tickets/bands/assignments, and game capability
profiles, plus the additive EF Core migration and entity configurations
backing them.
…es, matchmaking, and outbox

Adds LobbiesService (create/join/leave/start/credential rotation),
MatchmakingService/Coordinator (ticket lifecycle, band widening, proposal
building), the transactional outbox handlers and options, and the expiry
sweeper. Flips GameEntryActions gating for the three module-owned entry
points now that lobby/matchmaking is implemented.
…rs, and capability seeding

Adds the Postgres-backed lobby/matchmaking/outbox repositories, the
advisory-lock command runner, the HMAC join-credential hasher and
in-memory join-failure throttle, the lobby-expiry and matchmaking
background workers, the outbox dispatcher, and the game-capability
profile seeder with its versioned seed manifest.
…points

Adds LobbiesController, MatchmakingController, and MatchRematchController;
registers the new services/workers/options in the composition root and
appsettings.
Covers lobby lifecycle/credentials/host-transfer/readiness, matchmaking
band widening/proposal building/coordinator/outbox processing, and
capability-profile seeding, including Postgres-backed concurrency and
migration smoke tests. 862/862 unit, 375/375 integration against real
PostgreSQL.
The module-06 backend PR intermittently failed CI in
GameHostSerializerHardeningTests with Engine.ExecutionBudgetExceeded
instead of the expected rejection code, while the identical commit
passed on a separate CI trigger moments later. The integration suite
has no [Collection] fixtures, so every test class is its own xUnit
collection and runs in parallel by default; with ~340 test classes
now hitting a shared Postgres instance and spawning worker threads,
GitHub's 2-vCPU runners can starve the .NET thread pool enough that
GameHostInvoker's cooperative-cancellation watchdog (Execute, 550ms
budget) times out on trivial, non-CPU-bound work.

Disabling collection parallelism via xunit.runner.json removes the
contention without touching the engine's timing budget, which is
pinned by EngineLimitsTests and requires an ADR to change.
@MohanEhab
MohanEhab merged commit 4c2b8c3 into main Jul 12, 2026
2 checks passed
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