@@ -256,6 +256,9 @@ export const LogsRenderer = ({
256
256
return lastActionState
257
257
}
258
258
259
+ const areEventsProgressing =
260
+ triggerDetails . podStatus === POD_STATUS . PENDING || ! ! ( eventSource && eventSource . readyState <= 1 )
261
+
259
262
/**
260
263
* If initially parsedLogs are empty, and initialStatus is Success then would set opened as false on each
261
264
* If initialStatus is not success and initial parsedLogs are empty then would set opened as false on each except the last
@@ -297,19 +300,23 @@ export const LogsRenderer = ({
297
300
! ! targetSearchKey ,
298
301
)
299
302
} else {
303
+ const derivedStatus : StageStatusType = areEventsProgressing
304
+ ? StageStatusType . PROGRESSING
305
+ : StageStatusType . FAILURE
306
+
300
307
acc . push ( {
301
308
stage : stage || `Untitled stage ${ index + 1 } ` ,
302
309
startTime : startTime || '' ,
303
310
endTime : endTime || '' ,
304
311
// Would be defining the state when we receive the end status, otherwise it is loading and would be open
305
312
isOpen : getIsStageOpen (
306
- StageStatusType . PROGRESSING ,
313
+ derivedStatus ,
307
314
previousExistingStage . isOpen ,
308
315
// Wont be present in case of start stage since no logs are present yet
309
316
! ! searchKeyStatusMap [ stage ] ?. [ startTime ] ,
310
317
! ! targetSearchKey ,
311
318
) ,
312
- status : StageStatusType . PROGRESSING ,
319
+ status : derivedStatus ,
313
320
logs : [ ] ,
314
321
} )
315
322
}
@@ -363,7 +370,7 @@ export const LogsRenderer = ({
363
370
setStageList ( newStageList )
364
371
// NOTE: Not adding searchKey as dependency since on mount we would already have searchKey
365
372
// And for other cases we would use handleSearchEnter
366
- } , [ streamDataList ] )
373
+ } , [ streamDataList , areEventsProgressing ] )
367
374
368
375
const handleSearchEnter = ( searchText : string ) => {
369
376
handleSearch ( searchText )
@@ -383,9 +390,6 @@ export const LogsRenderer = ({
383
390
setStageList ( newLogs )
384
391
}
385
392
386
- const areEventsProgressing =
387
- triggerDetails . podStatus === POD_STATUS . PENDING || ( eventSource && eventSource . readyState <= 1 )
388
-
389
393
const renderLogs = ( ) => {
390
394
if ( areStagesAvailable ) {
391
395
return (
0 commit comments