brackt/app/services
Chris Parsons 623fb1dfc0
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 1m35s
🚀 Deploy / ʦ TypeScript (pull_request) Successful in 1m20s
🚀 Deploy / 🔍 Lint (pull_request) Successful in 49s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Fix slow bracket save and stale projected points
Saving a bracket result was slow and left the projected-points column
showing pre-result EVs until the next simulation.

Root causes:
- Side effects ran in the wrong order: recalculateAffectedLeagues
  (which reads EVs to compute projected points) fired before
  updateProbabilitiesAfterResult wrote the new EVs.
- calculateTeamProjectedScore issued one getParticipantEV query per
  unfinished pick, multiplied by every team in every affected league.

Changes:
- Swap side-effect order in processMatchResult, processPlayoffEvent,
  and the set-round-winners route so probabilities update first.
- Pre-fetch every EV referenced by a season's draft picks in a single
  inArray query inside recalculateStandings and pass the map down to
  calculateTeamProjectedScore (with a getParticipantEV fallback).
- Add skipProbabilities option to processPlayoffEvent and use it from
  autoCompleteRoundIfDone, where the caller has already refreshed EVs.

Fixes #31

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 21:23:40 -07:00
..
__tests__ Fix Discord double-ping when autodraft fires immediately after manual pick 2026-05-22 20:38:35 -07:00
simulations Add not-participating exclusion support for event results (#446) 2026-05-19 11:13:32 -07:00
standings-sync Add MLS standings sync and fix simulator conference resolution (#423) 2026-05-14 15:39:40 -07:00
bracket-simulator.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
brackt.server.ts Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
discord.ts Fix Discord pick announcements arriving out of order and add 429 retry 2026-05-24 21:29:02 -07:00
draft-autostart.ts Add auto-start draft at scheduled time (#437) (#438) 2026-05-16 23:37:29 -07:00
draft-discord.server.ts Fix Discord double-ping when autodraft fires immediately after manual pick 2026-05-22 20:38:35 -07:00
draft-email.server.ts Add draft email notifications feature (#459) 2026-05-20 15:35:43 -07:00
ev-calculator.ts fix: address VORP code review issues (#283) 2026-04-08 23:20:02 -04:00
icm-calculator.ts Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
probability-engine.ts Fix NCAAW futures odds simulation and admin import UX (#420) 2026-05-13 01:06:16 -07:00
probability-updater.ts Fix slow bracket save and stale projected points 2026-05-26 21:23:40 -07:00
sync-tournament-results.ts Canonical tournament layer: 2026-05-01 21:04:48 -07:00