codefordenver / codefordenver/Comrad

Show Builder issue - traffic events don't populate correctly in saved_items if the master_time_id of a series changes

Open
#552 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
JavaScript
Stars
25
Forks
9
PR merge metrics
No merged PRs in 30d

Description

## Description of Issue

If the series of a traffic event is modified after one of the traffic events is added to a saved_items list of Show Builder, the `saved_items` list will reference a `master_time_id` that does not exist.

## Possible Solution and/or Approach

Modify the file at `server\v1\controllers\playlists\utils\populateTrafficInstance.js` to:
- Remove the code that starts with the comment `// with legacy data from the old version of comrad,`. That code was a fix when I thought this could only occur with data imported from the old system.
- Replace it with code that, if a masterTimeId does not exist in the traffic series, generates a traffic event based on the series and the masterTimeId value. I believe you can do this by calculating the event start time of the traffic event by passing masterTimeId into `moment()`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading server/v1/controllers/playlists/utils/populateTrafficInstance.js, especially the section beginning with the legacy-data comment. Trace how saved_items traffic events are populated when a masterTimeId is absent from the series. Done means a changed series can still produce the referenced traffic event from the masterTimeId without relying on the old legacy-data path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.