Skip to content

fix(recruitment): order invited candidates by player_id#155

Merged
Sootopolis merged 1 commit into
mainfrom
fix/154-sort-invited-by-player-id
Jul 8, 2026
Merged

fix(recruitment): order invited candidates by player_id#155
Sootopolis merged 1 commit into
mainfrom
fix/154-sort-invited-by-player-id

Conversation

@Sootopolis

Copy link
Copy Markdown
Owner

What

Add ORDER BY player_id to RecruitmentCandidate.selectInvitedByRun and selectInvitedToday, which previously had no ORDER BY and so returned invited candidates in arbitrary PostgreSQL heap order.

selectInvitedByRun uses bare columns (ORDER BY player_id); selectInvitedToday aliases the table as rc (ORDER BY rc.player_id). Both feed the recruitment output list, --cumulative, and showReport.

Sorting by username would bias the list toward shorter/earlier-alphabet handles; player_id gives a stable, neutral order.

Fixes

Fixes #154.

Testing

  • New test: out-of-order inserts (pid2, pid0, pid1) return ascending [pid0, pid1, pid2] via selectInvitedByRun.
  • sbt "testOnly ...TestRecruitmentAppCore" — 23/23.
  • Full sbt test (pre-push) — 1019 passed.

Note

Open follow-up: selectInvitedToday spans multiple runs/day, where player_id alone is only a total order if invite-dedup guarantees one invited row per player per day. Tie-break tracked against the delivery redesign in #153.

🤖 Generated with Claude Code

selectInvitedByRun and selectInvitedToday had no ORDER BY, so PostgreSQL
returned invited candidates in arbitrary heap order — the same run could
render its usernames differently on re-report, and no stable order at all
across runs. Sorting by username would bias the list toward shorter/earlier
handles; player_id gives a stable, neutral order instead.

Fixes #154.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Sootopolis Sootopolis merged commit ea061c4 into main Jul 8, 2026
1 check passed
@Sootopolis Sootopolis deleted the fix/154-sort-invited-by-player-id branch July 8, 2026 00:43
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.

Sort invited usernames deterministically by player_id

1 participant