1.0.0-rc3 rc3
This commit is contained in:
@@ -1476,22 +1476,27 @@ function buildPipelineFromJob(job, currentPipeline, currentPipelineJobId) {
|
||||
: null;
|
||||
const liveState = String(liveJobProgress?.state || '').trim().toUpperCase();
|
||||
const isTerminalJobStatus = jobStatus === 'FINISHED' || jobStatus === 'ERROR' || jobStatus === 'CANCELLED';
|
||||
const ignoreStaleLiveProgress = isTerminalJobStatus && processingStates.includes(liveState);
|
||||
const mergedContext = liveContext
|
||||
const jobStatusIsRunning = processingStates.includes(jobStatus);
|
||||
const ignoreStaleLiveProgress = (
|
||||
(isTerminalJobStatus && processingStates.includes(liveState))
|
||||
|| (!jobStatusIsRunning && jobStatus !== 'IDLE' && processingStates.includes(liveState))
|
||||
);
|
||||
const effectiveLiveContext = ignoreStaleLiveProgress ? null : liveContext;
|
||||
const mergedContext = effectiveLiveContext
|
||||
? {
|
||||
...computedContext,
|
||||
...liveContext,
|
||||
...effectiveLiveContext,
|
||||
// Prefer the DB plan when it has been confirmed but the live (jobProgress) plan hasn't —
|
||||
// this happens when confirmEncodeReview is called with skipPipelineStateUpdate=true
|
||||
// (always the case for queued jobs), leaving jobProgress with the pre-confirmation plan.
|
||||
mediaInfoReview: (computedContext.mediaInfoReview?.reviewConfirmedAt && !liveContext.mediaInfoReview?.reviewConfirmedAt)
|
||||
mediaInfoReview: (computedContext.mediaInfoReview?.reviewConfirmedAt && !effectiveLiveContext.mediaInfoReview?.reviewConfirmedAt)
|
||||
? computedContext.mediaInfoReview
|
||||
: (liveContext.mediaInfoReview || computedContext.mediaInfoReview),
|
||||
tracks: (Array.isArray(liveContext.tracks) && liveContext.tracks.length > 0)
|
||||
? liveContext.tracks
|
||||
: (effectiveLiveContext.mediaInfoReview || computedContext.mediaInfoReview),
|
||||
tracks: (Array.isArray(effectiveLiveContext.tracks) && effectiveLiveContext.tracks.length > 0)
|
||||
? effectiveLiveContext.tracks
|
||||
: computedContext.tracks,
|
||||
selectedMetadata: computedContext.selectedMetadata || liveContext.selectedMetadata,
|
||||
cdRipConfig: liveContext.cdRipConfig || computedContext.cdRipConfig
|
||||
selectedMetadata: computedContext.selectedMetadata || effectiveLiveContext.selectedMetadata,
|
||||
cdRipConfig: effectiveLiveContext.cdRipConfig || computedContext.cdRipConfig
|
||||
}
|
||||
: computedContext;
|
||||
// The card always represents `job.id`; never let stale live context override it.
|
||||
|
||||
Reference in New Issue
Block a user