claude/discord-pick-notification-refactor-FeusJ #58

Merged
chrisp merged 2 commits from claude/discord-pick-notification-refactor-FeusJ into main 2026-05-29 16:24:23 +00:00

2 commits

Author SHA1 Message Date
Claude
5506af65fd
Fix three code-review findings from Discord notification refactor
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 1m38s
🚀 Deploy / ʦ TypeScript (pull_request) Successful in 1m26s
🚀 Deploy / 🔍 Lint (pull_request) Successful in 51s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
- Add reference-equality cleanup guard to enqueuePickNotification so
  leagueChains entries are deleted once a league's chain settles (matching
  the old queue's finally-block cleanup), while correctly skipping deletion
  if a new pick was enqueued before the current one resolved
- Use getTeamForPick from ~/lib/draft-order in draft.make-pick.ts and
  draft.force-manual-pick.ts instead of the inline calculatePickInfo +
  draftSlots.find pattern (draft-utils.ts has a same-named local function
  with a different signature so it keeps the two-liner)
- Replace pickedTeam?.name ?? teamId UUID fallback in force-manual-pick
  with expectedDraftSlot.team.name, which is already validated non-null
  by the route's own guard; also removes two duplicate draftSlots.find
  calls that re-searched for a slot already in hand

https://claude.ai/code/session_01GCkguG2muQwnh3WTvENrwJ
2026-05-29 16:15:31 +00:00
Claude
ad10bd3f7d
Simplify Discord pick notifications and fix force-manual-pick gap
- Replace 30-line Map+Set queue with a 4-line per-league promise chain in
  discord.ts — picks still arrive in order, errors don't break the chain
- Remove the internal DB re-queries from notifyPickMadeOnDiscord; callers
  now pre-resolve nextTeamName and nextTeamOwnerId from the draftSlots they
  already hold, eliminating the redundant team/owner lookups and the
  pickInRoundFor circular-import workaround
- Add the missing Discord notification to draft.force-manual-pick.ts (was
  the only pick path that never notified Discord)
- Update tests to match the simplified function signature

https://claude.ai/code/session_01GCkguG2muQwnh3WTvENrwJ
2026-05-29 15:38:09 +00:00