From cfcdfed70100c294ff98aa68179d7329d0d26d8a Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Fri, 16 Aug 2024 22:44:47 +0100 Subject: [PATCH] chore: duration can be equal to 0 --- src/helpers/update-tasks.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers/update-tasks.ts b/src/helpers/update-tasks.ts index cb1a30d..d1ac1f4 100644 --- a/src/helpers/update-tasks.ts +++ b/src/helpers/update-tasks.ts @@ -97,8 +97,11 @@ async function updateReminderForIssue(context: Context, repo: ListForOrg["data"] } const duration = taskDeadlineMatch[1] || ""; const durationInMs = ms(duration); - if (!durationInMs) { - logger.error(`Invalid duration found on ${issue.url}`); + if (durationInMs === 0) { + // it could mean there was no time label set on the issue + // but it could still be workable and priced + } else if (durationInMs < 0 || !durationInMs) { + logger.error(`Invalid deadline found on ${issue.url}`); return false; } metadata.taskDeadline = DateTime.fromMillis(lastCheck.toMillis() + durationInMs).toISO() || "";