@@ -442,10 +442,16 @@ export const useRunsForTimeline = ({
442
442
return Object . values ( jobsWithCompletedRunsAndOngoingRuns ) ;
443
443
} , [ jobsWithCompletedRunsAndOngoingRuns ] ) ;
444
444
445
+ const allKeys = useMemo (
446
+ ( ) => Object . keys ( jobsWithCompletedRunsAndOngoingRuns ) ,
447
+ [ jobsWithCompletedRunsAndOngoingRuns ] ,
448
+ ) ;
449
+
445
450
const unsortedJobs : TimelineRow [ ] = useMemo ( ( ) => {
446
451
if ( ! workspaceOrError || workspaceOrError . __typename === 'PythonError' || _end < Date . now ( ) ) {
447
452
return jobsWithCompletedRunsAndOngoingRunsValues ;
448
453
}
454
+ const addedJobKeys = new Set ( ) ;
449
455
const addedAdHocJobs = new Set ( ) ;
450
456
const jobs : TimelineRow [ ] = [ ] ;
451
457
for ( const locationEntry of workspaceOrError . locationEntries ) {
@@ -509,6 +515,7 @@ export const useRunsForTimeline = ({
509
515
const runs = [ ...jobRuns , ...jobTicks ] ;
510
516
511
517
let row = jobsWithCompletedRunsAndOngoingRuns [ jobKey ] ;
518
+ addedJobKeys . add ( jobKey ) ;
512
519
if ( row ) {
513
520
row = { ...row , runs} ;
514
521
} else {
@@ -531,6 +538,11 @@ export const useRunsForTimeline = ({
531
538
}
532
539
}
533
540
}
541
+ allKeys . forEach ( ( key ) => {
542
+ if ( ! addedJobKeys . has ( key ) ) {
543
+ jobs . push ( jobsWithCompletedRunsAndOngoingRuns [ key ] ! ) ;
544
+ }
545
+ } ) ;
534
546
return jobs ;
535
547
// Don't add start/end time as a dependency here since it changes often.
536
548
// Instead rely on the underlying runs changing in response to start/end changing
@@ -540,6 +552,7 @@ export const useRunsForTimeline = ({
540
552
jobsWithCompletedRunsAndOngoingRunsValues ,
541
553
runsByJobKey ,
542
554
jobsWithCompletedRunsAndOngoingRuns ,
555
+ allKeys ,
543
556
] ) ;
544
557
545
558
const jobsWithRuns = useMemo ( ( ) => {
0 commit comments