Skip to content

bug: matchmaking duplicates, repeat leaver bans, name registration and tournament chat - #409

Merged
lukepolo merged 2 commits into
mainfrom
fix/fork-triage-bugs
Sep 18, 2026
Merged

lukepolo merged 2 commits into
mainfrom
fix/fork-triage-bugs

Conversation

@lukepolo

Copy link
Copy Markdown
Contributor

Bugs found by comparing against the DEAFCS fork, plus the related holes each one exposed in our code.

Matchmaking

  • Two players confirming at the same moment created two matches for the same ten people; a re-sent confirm after the match existed created another. Creation is now claimed once per confirmation.
  • A confirm from a steam id outside the match counted toward the ready check.
  • Queue entries whose lobby details were gone stayed in the queue forever. They are swept, with a Lua guard so a lobby that leaves and rejoins is not swept with them.
  • The queue count counted lobbies, so a queued trio read as "1 in queue". It now counts players (needs the matching web change).

Leaver bans

  • abandoned_matches has no unique key and the cooldown counts rows, so one leave reported twice moved the player a rung up the ladder. Added UNIQUE (steam_id, match_id) (NULL match_id rows stay distinct) and both insert paths now ignore conflicts.

Names

  • registerName never checked name_registered, so a player could rename themselves without admin approval. It also accepted blank names.
  • requestNameChange took steam_id from the client, so a player could file a rename for someone else and have an admin approve it.

Match maps

  • The reported winner was only cross-checked against the round score on Finished. A map that stalls in WaitingForTV or UploadingDemo kept an unchecked winner. Surrendered deliberately keeps the reported winner, since the team that gives up is often ahead on rounds.

Tournament chat

  • Registered and waitlisted free agents were locked out of the chat and its notifications until the draft — in a free-agents tournament that left only the organizers. Same for joined_tournament, which is what puts the room in the sidebar, and for a team owner not on their own roster.
  • Membership is now re-checked when a message is sent, so withdrawing does not leave someone posting for the rest of the room's 24h TTL.

Teams

  • The owner could leave their own team. Nothing reassigned owner_steam_id, so the team was left owned by a non-member and only a site admin could manage it. Blocked in the database and hidden in the UI; ownership has to be handed over first.

Needs hasura migrate + codegen on the dev stack (one new migration; the generated constraint enum was added by hand in the meantime).

Tests: 878 unit, 1332 SQL.

…d tournament chat

- matchmaking created a second match when the last confirmations landed
  together, or when a player re-sent theirs after the match existed
- confirmations from players outside the match counted toward the ready check
- queue entries whose lobby details had expired were counted forever; sweep
  them, guarded so a lobby that rejoins is not swept with them
- the queue count reported lobbies, so a queued trio showed as 1
- abandoned_matches is now unique per (steam_id, match_id): the plugin can
  report one leave several times and each row escalated the cooldown a rung
- registerName had no already-registered check, so a player could rename
  without approval, and requestNameChange took the steam id from the client
- a map winner reported with WaitingForTV or UploadingDemo was never checked
  against the round score; Surrendered stays as reported
- tournament chat left registered and waitlisted free agents out, and did not
  re-check membership when a message was sent
- the team owner could leave their own team, leaving nobody able to manage it
@lukepolo
lukepolo force-pushed the fix/fork-triage-bugs branch from 9f2e4d0 to 8bc436a Compare September 18, 2026 03:35
@lukepolo
lukepolo merged commit cee594f into main Sep 18, 2026
2 checks passed
@lukepolo
lukepolo deleted the fix/fork-triage-bugs branch September 18, 2026 03:55
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