Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Filter out the undefined values
  • Loading branch information
matt-aitken committed Feb 12, 2025
commit 3b2b2bef82a6562e77297a14b3e2cd4ad76ddd47
13 changes: 8 additions & 5 deletions apps/webapp/app/v3/services/resumeAttempt.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,14 @@ export class ResumeAttemptService extends BaseService {

//find the best attempt for each batch item
//it should be the most recent one in a final state
const finalAttempts = dependentBatchItems.map((item) => {
return item.taskRun.attempts
.filter((a) => FINAL_ATTEMPT_STATUSES.includes(a.status))
.sort((a, b) => b.number - a.number)[0];
});
const finalAttempts = dependentBatchItems
.map((item) => {
return item.taskRun.attempts
.filter((a) => FINAL_ATTEMPT_STATUSES.includes(a.status))
.sort((a, b) => b.number - a.number)
.at(0);
})
.filter(Boolean);

completedAttemptIds = finalAttempts.map((a) => a.id);

Expand Down