Project

General

Profile

Actions

Bug #13

closed

PWHL Schedule Job not fetching all games for current season

Added by William Lang about 2 months ago. Updated about 2 months ago.

Status:
Done
Priority:
Low
Assignee:
-
Start date:
01/03/2026
Due date:
% Done:

0%

Estimated time:

Description

The PWHL season is still in progress but the schedule job appears to be incomplete - not all games are being fetched.

Symptoms:

  • PWHL season shows as not complete
  • Schedule job is running but missing games
  • Some games from the schedule are not appearing in the database

Investigation needed:

  • Check PWHL schedule job logs for errors
  • Verify API endpoint is returning all games
  • Check if there are pagination issues
  • Verify date range filters are correct for current season
  • Compare games in database vs games on PWHL schedule
  • Check if specific game types are being excluded incorrectly
Actions #1

Updated by William Lang about 2 months ago

Root Cause Identified:

The PwhlScheduleFetchJob exists and works correctly, but it was never configured to run automatically in config/recurring.yml.

Investigation Results:

  • Manually executed PwhlScheduleFetchJob successfully created 60 games for the 2024-25 season
  • All 60 games marked as "OFF" (finished)
  • Date range: 2025-01-02 to 2025-12-31
  • New PWHL teams created: Ottawa Charge, Seattle Torrent, Toronto Sceptres, Vancouver Goldeneyes

Fix Applied:

  • Added pwhl_schedule_sync job to config/recurring.yml for both production and development
  • Scheduled to run daily at 3:30am (after NHL SeasonSyncJob completes)
  • Uses season_id: "20242025", pwhl_season_id: 5

Files Changed:

  • config/recurring.yml

The PWHL schedule will now automatically sync daily.

Actions #2

Updated by William Lang about 2 months ago

Root Cause Identified:

The PwhlScheduleFetchJob was never configured to run automatically in config/recurring.yml. Additionally, the 2025-26 season is missing 30 games.

Investigation Results (2025-26 Season):

  • Currently: 90 games in database
  • Expected: 120 games (30 games per team × 8 teams / 2)
  • Missing: 30 games
  • Games by state: 26 finished (OFF), 64 future (FUT)
  • Date range: 2025-11-21 to 2026-04-25
  • Season ID mapping: PWHL season ID 8 → IcyData season "20252026"

Fix Applied:

  • Added pwhl_schedule_sync job to config/recurring.yml for both production and development
  • Scheduled to run daily at 3:30am (after NHL SeasonSyncJob completes)
  • Uses season_id: "20252026", pwhl_season_id: 8

Files Changed:

  • config/recurring.yml

Note: The remaining 30 games are not yet available in the PWHL HockeyTech API. They will automatically be fetched once the API provides them (likely released in blocks as the season progresses). The recurring job will check daily for new games.

Actions #3

Updated by William Lang about 2 months ago

Solution Implemented:

Added a "Fetch PWHL Schedule" button to the admin season dashboard (similar to the NHL schedule button). This button:

  1. Only appears for seasons associated with the PWHL league
  2. Automatically determines the correct PWHL season ID based on the IcyData season_id
  3. Enqueues a background job to fetch all games from the PWHL API
  4. No hardcoded years in recurring jobs

Season ID Mapping:

  • 20232024 → PWHL Season 1
  • 20242025 → PWHL Season 5
  • 20252026 → PWHL Season 8

Files Changed:

  • app/controllers/api/v1/admin/seasons_controller.rb (added fetch_pwhl_schedule endpoint)
  • config/routes.rb (added route)
  • app/frontend/pages/admin/SeasonDetail.jsx (added UI button)

Usage:

  1. Navigate to Admin → Seasons
  2. Click on a PWHL season (e.g., 2025-26)
  3. Click "Fetch PWHL Schedule" button in the Actions section

The PWHL API currently provides 90 out of expected 120 games for the 2025-26 season. The remaining games will be added by the PWHL as the season progresses. Admins can click the button again to fetch newly released games.

Actions #4

Updated by William Lang about 2 months ago

  • Status changed from Backlog to In Progress

Fixed accent handling in PWHL schedule service - all 120 games now import successfully

Actions #5

Updated by William Lang about 2 months ago

  • Status changed from In Progress to Done

Verified: All 120 PWHL games now importing successfully. 34 finished games through Jan 2, 2026. Montreal team lookup works for all accent variants.

Actions

Also available in: Atom PDF