Skip to content

Commit

Permalink
Add +1 to attempts (#761)
Browse files Browse the repository at this point in the history
Since "attempts" is zero-indexed, we need to add 1 to the Attempts badge for tasks that have retried.
  • Loading branch information
adhityamamallan authored Dec 13, 2024
1 parent d0fa4ab commit ef967da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ export default function getActivityGroupFromEvents(
}
if (startEvent && startEvent[startAttr]?.attempt) {
const attempts = startEvent[startAttr].attempt;

badges.push({
content: `${attempts} Attempt${attempts !== 1 ? 's' : ''}`,
content: `${attempts + 1} Attempts`,
});
}
if (firstEvent.attributes !== 'activityTaskScheduledEventAttributes') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function getDecisionGroupFromEvents(
if (scheduleEvent && scheduleEvent[scheduleAttr]?.attempt) {
const attempts = scheduleEvent[scheduleAttr].attempt;
badges.push({
content: `${attempts} Attempt${attempts !== 1 ? 's' : ''}`,
content: `${attempts + 1} Attempts`,
});
}
const eventToLabel: HistoryGroupEventToStringMap<DecisionHistoryGroup> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function getSingleEventGroupFromEvents(
) {
const attempts = event.workflowExecutionStartedEventAttributes.attempt;
badges.push({
content: `${attempts} Attempt${attempts !== 1 ? 's' : ''}`,
content: `${attempts + 1} Attempts`,
});
}

Expand Down

0 comments on commit ef967da

Please sign in to comment.