Guide for verifying the week calculation fix and monitoring odds ingestion
The workflow requested Week 10 odds but fetched Week 11 games instead. All 30 matched games were Week 11.
The getCurrentCFBWeek() method in OddsApiAdapter.ts was hardcoded to return week 8.
This caused Week 10 requests to use the live endpoint instead of historical, returning all upcoming games (Week 11).
Changed getCurrentCFBWeek() to query the database and find the actual current week based on game dates closest to now. This ensures past weeks correctly use historical endpoint and current week uses live endpoint.
Commit: d215247
[DEBUG] Historical check: season=2025, currentYear=2025, week=10, currentWeek=11, isHistorical=true
Should show currentWeek=11 (from database query) and isHistorical=true
[ODDSAPI] Using historical data endpoint for 2025 week 10
Should use historical endpoint, not live endpoint
Should match Week 10 games (not Week 11) and include the previously missing 8 FBS games:
Correct Week Detection
[DEBUG] Historical check: ... currentWeek=11, isHistorical=true
Historical Endpoint Used
[ODDSAPI] Using historical data endpoint for 2025 week 10
Week 10 Games Matched
[DEBUG] Found game: 2025-wk10-delaware-liberty for ...
Game IDs should start with 2025-wk10- (not 2025-wk11-)
Still Using Live Endpoint ❌
[ODDSAPI] Using live odds endpoint for 2025 week 10
If you see this, the week calculation might still be wrong
Wrong Week Games ❌
[DEBUG] Found game: 2025-wk11-...
If game IDs are still Week 11, historical endpoint isn't working correctly
Run these SQL queries to verify the fix worked:
1. Check Database Count
SELECT COUNT(DISTINCT g.id) as games_with_odds FROM games g WHERE g.season = 2025 AND g.week = 10 AND EXISTS (SELECT 1 FROM market_lines ml WHERE ml.game_id = g.id);
Should be 40-50 games (up from 39)
2. Verify Fixed Games
SELECT g.id, COUNT(DISTINCT ml.id) as market_line_count FROM games g LEFT JOIN market_lines ml ON ml.game_id = g.id WHERE g.id IN ( '2025-wk10-delaware-liberty', '2025-wk10-florida-international-missouri-state', '2025-wk10-new-mexico-unlv' ) GROUP BY g.id;
All 3 should show market_line_count > 0
All 3 previously missing games now have odds:
0383d62): Changed getCurrentCFBWeek() to find the week with upcoming games instead of closest datesmissouri-state and delaware from denylistNote: This document is also available as a markdown file in the repository:
View on GitHub →