sofie-core icon indicating copy to clipboard operation
sofie-core copied to clipboard

feat: syncIngestUpdateToPartInstance is called when a Part is orphaned, and allows for removing the PartInstance

Open Julusian opened this issue 1 year ago • 1 comments

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

feature

  • What is the new behavior (if this is a feature change)?

The blueprint method shouldRemoveOrphanedPartInstance has been combined into syncIngestUpdateToPartInstance. To achieve this, a new method has been added to the context removePartInstance(). It is only valid to call this when playStatus: 'next', at any other time it will throw.

This was to let syncIngestUpdateToPartInstance decide to remove a PartInstance when the Part has become invalid. That case didn't fit under the shouldRemoveOrphanedPartInstance concept. Once it was able to do this, it felt like it made sense to merge shouldRemoveOrphanedPartInstance into it too, so that there was a single blueprint call that would cover all cases.

This does require some blueprints updates, as syncIngestUpdateToPartInstance is called with undefined passed as the Part for any orphaned PartInstances. Additionally, for any orphaned PartInstances, core was previously propogating changes to onEnd infinites. This is no longer done, and should be handled inside of syncIngestUpdateToPartInstance if that behaviour is desired.

  • Other information:

Status

  • [ ] Code documentation for the relevant parts in the code have been added/updated by the PR author
  • [ ] The functionality has been tested by the PR author
  • [ ] The functionality has been tested by NRK

Julusian avatar Aug 03 '22 14:08 Julusian

Codecov Report

Merging #750 (befd4d7) into release44 (f1e15f6) will increase coverage by 0.15%. The diff coverage is 42.59%.

@@              Coverage Diff              @@
##           release44     #750      +/-   ##
=============================================
+ Coverage      68.23%   68.38%   +0.15%     
=============================================
  Files            279      278       -1     
  Lines          33774    33739      -35     
  Branches        4516     4512       -4     
=============================================
+ Hits           23046    23074      +28     
+ Misses         10270    10207      -63     
  Partials         458      458              
Impacted Files Coverage Δ
packages/job-worker/src/ingest/commit.ts 85.25% <ø> (-0.18%) :arrow_down:
...job-worker/src/ingest/syncChangesToPartInstance.ts 22.32% <2.85%> (+1.25%) :arrow_up:
...ueprints/context/syncIngestUpdateToPartInstance.ts 22.05% <16.66%> (-0.49%) :arrow_down:
packages/blueprints-integration/src/context.ts 100.00% <100.00%> (ø)
packages/job-worker/src/blueprints/context/lib.ts 91.42% <100.00%> (+1.54%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Aug 03 '22 14:08 codecov-commenter

⚡ Published prerelease version shared-lib@1.44.0-nightly-feat-sync-invalid-for-next-20220803-134847-befd4d7.0 to NPM

github-actions[bot] avatar Sep 22 '22 08:09 github-actions[bot]

⚡ Published prerelease version server-core-integration@1.44.0-nightly-feat-sync-invalid-for-next-20220803-134847-befd4d7.0 to NPM

github-actions[bot] avatar Sep 22 '22 08:09 github-actions[bot]

⚡ Published prerelease version blueprints-integration@1.44.0-nightly-feat-sync-invalid-for-next-20220803-134847-befd4d7.0 to NPM

github-actions[bot] avatar Sep 22 '22 08:09 github-actions[bot]