brackt/app/routes/api
Claude 6e0db1304d
Fix all code review issues across timer, rollback, start, and draft-utils
server/timer.ts:
- Remove noisy per-tick console.log that fired every second per active draft
- Remove slot:any type cast (Drizzle query results are already typed)
- Fix inconsistent autodraftSettings argument in the === 0 trigger path
  to match the <= 0 path (pass null when autodraft is disabled)
- Fix infinite auto-pick loop: triggerAutoPick now returns boolean;
  on failure the draft is paused and a draft-paused socket event is
  emitted so clients and commissioners are notified. "Pick already made"
  (race condition) is treated as success, not failure.

draft.start.ts:
- Validate that draft slots exist before updating season status to draft.
  Previously a missing-slots error left the season stuck in draft status
  with no timer rows.

draft.rollback.ts:
- Guard against empty draftSlots before performing snake draft math,
  which would produce Infinity/NaN with zero teams.

draft-utils.ts:
- Convert checkAndTriggerNextAutodraft from recursive to iterative.
  The mutual recursion (executeAutoPick → checkAndTriggerNextAutodraft
  → executeAutoPick) is now a while loop, preventing unbounded call
  stack growth in all-autodraft leagues. Add chainEnabled param to
  executeAutoPick so chain calls skip spawning a second chain.
- Restructure getTopAvailableParticipant so the single-sport query is
  only built when actually needed (not thrown away in the multi-sport
  branch).
- Update misleading timeUsed comment to accurately describe that the
  stored value is the team's bank balance at pick time, not time spent.

https://claude.ai/code/session_01YPxgcQywG57KiXj7m46gLV
2026-02-23 00:58:13 +00:00
..
__tests__ feat: Implement drag-and-drop functionality for queue items; add duplicate prevention for participants in queue 2025-10-25 21:02:16 -07:00
webhooks refactor: simplify user update logic in Clerk webhook handler to reuse findOrCreateUser 2025-10-14 21:50:07 -07:00
autodraft.update.ts refactor: update import paths to use absolute paths for better clarity and maintainability 2025-10-24 21:20:19 -07:00
draft.adjust-time-bank.ts Add commissioner time bank adjustment feature for draft (#22) 2026-02-22 16:16:51 -08:00
draft.force-autopick.ts Improve draft room UX with better error handling and UI refinements (#17) 2026-02-20 21:50:27 -08:00
draft.force-manual-pick.ts Improve draft room UX with better error handling and UI refinements (#17) 2026-02-20 21:50:27 -08:00
draft.make-pick.ts Add draft clock UI, Fischer increment timer logic, and security fixes (#19) 2026-02-21 16:51:12 -08:00
draft.pause.ts Improve draft room UX with better error handling and UI refinements (#17) 2026-02-20 21:50:27 -08:00
draft.replace-pick.ts Add commissioner replace pick and draft rollback features (#18) 2026-02-20 22:47:29 -08:00
draft.resume.ts Improve draft room UX with better error handling and UI refinements (#17) 2026-02-20 21:50:27 -08:00
draft.rollback.ts Fix all code review issues across timer, rollback, start, and draft-utils 2026-02-23 00:58:13 +00:00
draft.start.ts Fix all code review issues across timer, rollback, start, and draft-utils 2026-02-23 00:58:13 +00:00
queue.add.ts feat: Implement drag-and-drop functionality for queue items; add duplicate prevention for participants in queue 2025-10-25 21:02:16 -07:00
queue.clear.ts feat: add queue management UI and API endpoints for draft room 2025-10-17 17:42:40 -07:00
queue.remove.ts feat: add queue management UI and API endpoints for draft room 2025-10-17 17:42:40 -07:00
queue.reorder.ts Improve draft room UX with better error handling and UI refinements (#17) 2026-02-20 21:50:27 -08:00