fix(cli): use jobId instead of id in cron list output

Fixes #4373

The Gateway returns jobs with `jobId` as the canonical identifier, but
the CLI was using `job.id` which is undefined, causing a crash when
trying to call .padEnd() on undefined.

This change uses `job.jobId ?? job.id ?? ""` for backwards compatibility
with any legacy code that might still use `id`.
This commit is contained in:
Samir Rayani 2026-01-29 23:05:56 -06:00
parent 4de0bae45a
commit 95de3f820c

View File

@ -141,7 +141,7 @@ export function printCronList(jobs: CronJob[], runtime = defaultRuntime) {
const now = Date.now();
for (const job of jobs) {
const idLabel = pad(job.id, CRON_ID_PAD);
const idLabel = pad(job.jobId ?? job.id ?? "", CRON_ID_PAD);
const nameLabel = pad(truncate(job.name, CRON_NAME_PAD), CRON_NAME_PAD);
const scheduleLabel = pad(
truncate(formatSchedule(job.schedule), CRON_SCHEDULE_PAD),