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

fix: prevent queued Part from hijacking infinite Pieces from the following Part(s) #1396

Open
wants to merge 1 commit into
base: release52
Choose a base branch
from

Conversation

ianshade
Copy link
Contributor

@ianshade ianshade commented Mar 6, 2025

About the Contributor

This pull request is posted on behalf of TV 2 Norge

Type of Contribution

This is a:

Bug fix

Current Behavior

Pieces that should start at the beginning of the Part following the dynamically inserted one, will start in the dynamically inserted Part instead. See: #1392
The problem is in the rank of the inserted part, initially set to a placeholder 99999, which tricks the logic finding infinites to continue into believing that the inserted part is the very last part of the segment.

New Behavior

In order to fix the bug, the operations are reordered: first the new rank of the part is calculated, then the infinites to continue are gathered.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

This PR affects the Sofie Core playout logic around adlibbing, specifically queueing adlib parts.

Time Frame

We consider the bug to be severe, because it leads to unexpected results on the PGM output when some future infinites are hijacked, so it would be great to merge this fix into release52

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

… the following Part(s)

problem was in the rank initially set to a placeholder 99999
recalculated too late, it was confusing the code that finds infinites from pieces in parts preceding the inserted one
@ianshade ianshade requested a review from a team as a code owner March 6, 2025 04:59
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 56.22%. Comparing base (33514b1) to head (f222545).
Report is 64 commits behind head on release52.

Files with missing lines Patch % Lines
packages/job-worker/src/playout/adlibUtils.ts 91.66% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           release52    #1396      +/-   ##
=============================================
- Coverage      56.38%   56.22%   -0.17%     
=============================================
  Files            406      408       +2     
  Lines          72655    73111     +456     
  Branches        4602     4187     -415     
=============================================
+ Hits           40967    41106     +139     
- Misses         31469    31879     +410     
+ Partials         219      126      -93     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jstarpl jstarpl added Contribution External contribution Contribution from TV 2 Norge Contributions sponsored by TV 2 Norge (tv2.no) labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution from TV 2 Norge Contributions sponsored by TV 2 Norge (tv2.no) Contribution External contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants