Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure season_num is set properly on allocation #1072

Open
Tracked by #1054
markspolakovs opened this issue Sep 24, 2022 · 0 comments
Open
Tracked by #1054

Ensure season_num is set properly on allocation #1072

markspolakovs opened this issue Sep 24, 2022 · 0 comments
Assignees
Labels

Comments

@markspolakovs
Copy link
Member

markspolakovs commented Sep 24, 2022

We've had a few reports of two seasons on the same show both showing up as "season 1", which goes away once the cache is bopped. Here's my hunch as to what's happening:

  1. when MyRadio_Season::getInstance is called, before allocate() is called, it computes season_num through SQL:
(
    SELECT COUNT(*) FROM schedule.show_season
    WHERE show_id=(SELECT show_id FROM schedule.show_season WHERE show_season_id=$1)
    AND show_season_id<=$1
    AND show_season_id IN (SELECT show_season_id FROM schedule.show_season_timeslot)
) AS season_num

At this point, the unallocated season has a season_num of the last allocated one.
2. MyRadio_Season->allocate() is called, which schedules timeslots, but does not update season_num
3. The object is written back to the cache, with the incorrect season_num.

The fix is likely to re-compute season_num in allocate().

For #1054.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant