brackt/app/routes/api
Chris Parsons 789408e428
Fix chess clock increment not applied to all pick types (#67 regression) (#220)
Fixes #220

When standard draft mode was added, the chess clock increment was
accidentally restricted to owner-only picks. Commissioner, admin, and
auto-picks stopped earning the increment, causing teams that timed out
to freeze at 0s and instant-autopick every subsequent round.

Fix:
- make-pick: all pick types earn the increment in chess clock mode
- force-manual-pick: same; deduplicate standard/chess-clock branches
  into a single update with mode-selected SQL; remove now-unused
  timerSnapshot query
- draft-utils executeAutoPick: restore increment for chess clock
  auto-picks; add missing seed insert when no timer row exists
- server/timer.ts: fix fallback initialization to use draftIncrementTime
  in standard mode (was always using draftInitialTime)
- leagues/$leagueId.tsx: show Draft Timer Mode in League Info panel

Tests:
- Update draft.make-pick.timer-mode to cover owner/commissioner/admin
  in both modes (commissioner section previously asserted frozen bank)
- Add draft.force-manual-pick.timer-mode for commissioner/admin force
  picks in both modes
- Add executeAutoPick.timer for timer-triggered auto-picks in both modes
- Update draft.force-manual-pick to reflect new chess clock behavior
- Replace fragile toHaveBeenCalledTimes(2) assertions with
  toHaveBeenCalledWith checks on the timer set call

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 17:00:32 -07:00
..
__tests__ Fix chess clock increment not applied to all pick types (#67 regression) (#220) 2026-03-24 17:00:32 -07:00
webhooks Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
autodraft.update.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
draft.adjust-time-bank.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
draft.force-autopick.ts Grant sitewide admins commissioner-level access in leagues (#162) 2026-03-18 00:41:56 -07:00
draft.force-manual-pick.ts Fix chess clock increment not applied to all pick types (#67 regression) (#220) 2026-03-24 17:00:32 -07:00
draft.make-pick.ts Fix chess clock increment not applied to all pick types (#67 regression) (#220) 2026-03-24 17:00:32 -07:00
draft.pause.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
draft.replace-pick.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
draft.resume.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
draft.rollback.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
draft.start.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
queue.add.ts feat: implement real-time queue updates via socket events in queue actions (#63) 2026-03-04 21:39:54 -08:00
queue.clear.ts feat: implement real-time queue updates via socket events in queue actions (#63) 2026-03-04 21:39:54 -08:00
queue.remove.ts feat: implement real-time queue updates via socket events in queue actions (#63) 2026-03-04 21:39:54 -08:00
queue.reorder.ts feat: implement real-time queue updates via socket events in queue actions (#63) 2026-03-04 21:39:54 -08:00
seasons.$seasonId.draft.ts Optimize user data fetching with batch queries and centralize display name logic (#176) 2026-03-18 16:46:07 -07:00