Files
sor/Server/src
fd95cce564 Fix: only abandon Initializing sessions older than 60 s at startup
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>
2026-03-09 17:23:36 -04:00
..
2026-02-28 17:02:43 -05:00