MatchmakerService is registered before GameStartupCleanupService in
Program.cs. BackgroundService.StartAsync fires ExecuteAsync on a
background thread and returns immediately, so the matchmaker's first
tick runs concurrently with the cleanup's StartAsync. If players were
already in the queue when the process restarted, the matchmaker creates
a fresh Initializing session within the first milliseconds of startup —
and the cleanup's ToListAsync would include it, abandoning a brand-new
session before game.ready could be sent.
Adding a 60-second staleness threshold: sessions younger than 60 s are
left alone; only genuinely stale sessions (from the previous process)
are abandoned. A legitimate game.ready exchange completes in < 10 s, so
60 s is a safe lower bound.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>