From c0c514805e7be52b5e86ccb507c448a6f69eac9b Mon Sep 17 00:00:00 2001 From: Recoup Agent Date: Mon, 9 Mar 2026 14:52:39 +0000 Subject: [PATCH] agent: Scheduled actions have been reported to be crashing the page for some ac --- .../VercelChat/dialogs/tasks/TaskDetailsDialogContent.tsx | 2 +- components/VercelChat/tools/tasks/TaskCard.tsx | 4 ++-- lib/tasks/isRecurring.ts | 1 + lib/tasks/parseCronToHuman.ts | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/VercelChat/dialogs/tasks/TaskDetailsDialogContent.tsx b/components/VercelChat/dialogs/tasks/TaskDetailsDialogContent.tsx index 51aad9464..7b3416814 100644 --- a/components/VercelChat/dialogs/tasks/TaskDetailsDialogContent.tsx +++ b/components/VercelChat/dialogs/tasks/TaskDetailsDialogContent.tsx @@ -95,7 +95,7 @@ const TaskDetailsDialogContent: React.FC = ({ /> ) : ( diff --git a/components/VercelChat/tools/tasks/TaskCard.tsx b/components/VercelChat/tools/tasks/TaskCard.tsx index dfa54fc8b..7a78c0667 100644 --- a/components/VercelChat/tools/tasks/TaskCard.tsx +++ b/components/VercelChat/tools/tasks/TaskCard.tsx @@ -78,11 +78,11 @@ const TaskCard: React.FC = ({ task, isDeleted, ownerEmail }) => {
- {isRecurring(task.schedule) && ( + {task.schedule && isRecurring(task.schedule) && ( )} - {parseCronToHuman(task.schedule.trim())} + {task.schedule ? parseCronToHuman(task.schedule.trim()) : "No schedule"}
diff --git a/lib/tasks/isRecurring.ts b/lib/tasks/isRecurring.ts index 067ad1e28..41e3c37d7 100644 --- a/lib/tasks/isRecurring.ts +++ b/lib/tasks/isRecurring.ts @@ -2,6 +2,7 @@ * Checks if a cron expression represents a recurring schedule (daily, weekly, or monthly) */ export const isRecurring = (cronExpression: string): boolean => { + if (!cronExpression) return false; try { const parts = cronExpression.split(" "); if (parts.length >= 5) { diff --git a/lib/tasks/parseCronToHuman.ts b/lib/tasks/parseCronToHuman.ts index 2325f7ee9..fbdc8120c 100644 --- a/lib/tasks/parseCronToHuman.ts +++ b/lib/tasks/parseCronToHuman.ts @@ -1,6 +1,7 @@ import cronstrue from "cronstrue"; export const parseCronToHuman = (cronExpression: string): string => { + if (!cronExpression) return "No schedule"; try { return cronstrue.toString(cronExpression); } catch (e) {