Phase 5 — Independent job fixes #411

Closed
opened 2026-08-21 17:40:59 +02:00 by johnsturgeon · 1 comment
Owner

Parent: #406

Revised 2026-08-25. Line references refreshed against main.

Why

None of these block anything else in the epic and they have no ordering
constraint between them. Good filler when another phase is blocked on review.
Each is its own PR.

Tasks

  • (moved to #425) Split the odds fetch from the games fetch in NflApi. games
    (tank01_api.py:256) unconditionally calls self.odds_data, which loops
    /getNFLBettingOdds once per distinct game date — 3–4 calls every time
    anything just wants kickoff times. Once odds_state exists (#408) a
    locked week never wants odds again, but flex scheduling means the
    schedule still gets re-fetched all week. A flag or a separate property is
    enough; callers that want both are unaffected.
    Bites: every poll of a locked week, on a metered plan.
  • (closed as not fixing) sync_team_records per-team error handling.
    nfl.find_teams(team_id=...)[0] raises IndexError on an unmatched id
    and takes out the whole sync rather than one team.
    Bites: a provider renaming or dropping a team id.
  • (closed as not fixing) update_player_records handles inactive players. It zeroes and
    recomputes only Player.active_players(), so an inactive player keeps
    whatever totals they had when they were deactivated — forever, including
    across a season rollover where the columns are supposed to reset.
    Bites: whenever an inactive player's record is displayed.
  • (resolved) sync_won_the_week guard on empty picks. It sorts players by
    wins_for_week and compares the top two with no check that any picks
    exist. It survives a zero-pick week only because 0 > 0 is false — the
    one award path relying on arithmetic rather than an explicit guard.

Removed

  • Batch _update_one_game's API calls. Superseded by #410: per-game
    jobs became a single live-games job, so the ~16× multiplier stops existing
    rather than getting optimized. Do not fix here — it would be thrown away.
  • Admin unlock escape hatch. Dropped to a single guarded setter in
    #410 — flip odds_state, refuse if picks exist, log it. No unlock state to
    track, so nothing to build.

Done when

Each is closed by its own PR. There is no combined acceptance criterion.

Parent: #406 > **Revised 2026-08-25.** Line references refreshed against `main`. ## Why None of these block anything else in the epic and they have no ordering constraint between them. Good filler when another phase is blocked on review. Each is its own PR. ## Tasks - [x] (moved to #425) **Split the odds fetch from the games fetch in `NflApi`.** `games` (`tank01_api.py:256`) unconditionally calls `self.odds_data`, which loops `/getNFLBettingOdds` once per distinct game date — 3–4 calls every time anything just wants kickoff times. Once `odds_state` exists (#408) a locked week never wants odds again, but flex scheduling means the schedule still gets re-fetched all week. A flag or a separate property is enough; callers that want both are unaffected. *Bites: every poll of a locked week, on a metered plan.* - [x] (closed as not fixing) **`sync_team_records` per-team error handling.** `nfl.find_teams(team_id=...)[0]` raises `IndexError` on an unmatched id and takes out the whole sync rather than one team. *Bites: a provider renaming or dropping a team id.* - [x] (closed as not fixing) **`update_player_records` handles inactive players.** It zeroes and recomputes only `Player.active_players()`, so an inactive player keeps whatever totals they had when they were deactivated — forever, including across a season rollover where the columns are supposed to reset. *Bites: whenever an inactive player's record is displayed.* - [x] (resolved) **`sync_won_the_week` guard on empty picks.** It sorts players by `wins_for_week` and compares the top two with no check that any picks exist. It survives a zero-pick week only because `0 > 0` is false — the one award path relying on arithmetic rather than an explicit guard. ## Removed - **~~Batch `_update_one_game`'s API calls.~~** Superseded by #410: per-game jobs became a single live-games job, so the ~16× multiplier stops existing rather than getting optimized. Do not fix here — it would be thrown away. - **~~Admin unlock escape hatch.~~** Dropped to a single guarded setter in #410 — flip `odds_state`, refuse if picks exist, log it. No unlock state to track, so nothing to build. ## Done when Each is closed by its own PR. There is no combined acceptance criterion.
Author
Owner

Reviewed all the tasks, and moved the only one I think is relevant to a new task

Reviewed all the tasks, and moved the only one I think is relevant to a new task
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
johnsturgeon/tgfp-web#411
No description provided.