Skip to content

Fix minor correctness issues for older years - #416

Open
chondl wants to merge 1 commit into
avgupta456:masterfrom
chondl:quality-fixes
Open

Fix minor correctness issues for older years#416
chondl wants to merge 1 commit into
avgupta456:masterfrom
chondl:quality-fixes

Conversation

@chondl

@chondl chondl commented Jul 11, 2026

Copy link
Copy Markdown

Three independent minor correctness fixes surfaced by a full staging audit performed by Claude Code. Each is small and self-contained. Verified against a local rig (CockroachDB + fake-gcs + full 2026 season, 3724 teams / 215 events / 18372 matches).

1. Team pages bubble chart /teams?year=2021 unhandled exception

RP_NAMES (frontend/src/constants.tsx) has no 2021 key (2021 had no traditional season). The teams Bubble Chart columnOptions dereferenced RP_NAMES[year][0] for any year >= 2016, throwing a TypeError at render → "Application error: a client-side exception has occurred". /events?year=2021 already degrades gracefully; /teams now does too.

Fix: guard the two ranking-point columns on RP_NAMES[year] instead of year >= 2016, so a no-season year drops those columns and falls through to the normal no-data state.

2. Match pages display literal "NaN" in predicted component cells for pre-2016 match pages

On pre-component-era matches (2002–2015, e.g. /match/2015casj_qm1) the Predicted Auto/Teleop/Endgame/Fouls alliance totals sum per-team component EPAs that don't exist for those years, producing NaN, which rendered as the literal text "NaN". Sibling cells already use "N/A".

Fix: treat a NaN alliance total the same as null and render "N/A".

3. Winner incorrect for 2015 elimination matches

get_event_matches (backend/src/tba/read_tba.py) forced winner = None for every 2015 match that wasn't a Final, and fell back to TIE (never a score comparison) when TBA's winning_alliance was absent. 2015 QF/SF elims — which did have winners — came back winner-less (14/16 elims on 2015new), breaking win/loss records, event prediction accuracy, and the match "Actual Winner" display. 2015 quals (Recycle Rush, cooperative) legitimately have no winner.

Fix: when winning_alliance is absent, derive the winner from the alliance scores; restrict the 2015 winner-less rule to quals (comp_level == "qm") only.

Verified against live TBA for 2015new/2015casj: before → QF 8/8 + SF 6/6 winner-less; after → all elim winners derived from score, all quals still winner-less.

- teams Bubble Chart: guard RP_NAMES[year] so a no-season year (2021)
  renders its graceful no-data state instead of a client-side crash
- match breakdown: render N/A instead of literal NaN in predicted
  Auto/Teleop/Endgame/Fouls totals on pre-component-era (2002-2015) matches
- TBA parsing: derive elim match winners from scores when winning_alliance
  is absent (2015 QF/SF), keeping 2015 quals winner-less
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

@chondl is attempting to deploy a commit to the avgupta456's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant