mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
6237a25a69
Found by reading the code, not a failing test: no path anywhere transitioned a queue ticket from PROPOSED back to QUEUED after a proposal was declined. A stranded PROPOSED ticket is invisible to the matcher (ListQueuedCandidates only ever reads state='QUEUED'), still counts as that player's one active ticket (blocking a fresh queue_create), and is renewable forever by an ordinary heartbeat -- a player proposed a match with someone who then declines had no way back into matchmaking without realising, on their own, that they needed to manually cancel first. This affects every participant, not just the decliner: an uninvolved player who never even responded was left stuck by someone else's decision. ProposalDeclineRequeueSQL requeues every participant's ticket, including the decliner's own -- nothing yet enforces the decline cooldown task 8.17 documents as a separate, not-yet-built feature, so leaving anyone behind at PROPOSED today isn't "cooldown behaviour", it's just broken. Once that cooldown exists it can exempt the decliner from this immediate requeue; today nothing does. Covered by a real PostgreSQL integration test: after one player declines, both the decliner's and an uninvolved participant's tickets land back at QUEUED with a refreshed expiry, and -- the actual end-to-end regression -- both are visible again to ListQueuedCandidates, the same query the matcher itself uses. Clean across 5 runs, plus the full integration and unit suites.