- 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
- 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