Skip to content

fix(schedules): default absent second/minute/hour to 0 when editing#3653

Open
tegan-temporal wants to merge 1 commit into
mainfrom
DT-4249-schedules-everyday-schedule-with-the-ui-does-not-have-any-future-runs-scheduled
Open

fix(schedules): default absent second/minute/hour to 0 when editing#3653
tegan-temporal wants to merge 1 commit into
mainfrom
DT-4249-schedules-everyday-schedule-with-the-ui-does-not-have-any-future-runs-scheduled

Conversation

@tegan-temporal

Copy link
Copy Markdown
Contributor

Problem

Editing a schedule whose structured calendar omits second/minute/hour left it with no future runs.

getFormSpecFromSpec mapped a missing time field to an empty range array. On save that serializes to an omitted field, and the server compiles an empty second/minute/hour range to match nothing — the 0 default is only filled for the deprecated string CalendarSpec, not a directly-supplied StructuredCalendarSpec.

Fix

Fall back to a 0 range for these fields, mirroring how dayOfMonth/dayOfWeek/month already handle absent fields. Test updated.

When an existing schedule's structured calendar omits second/minute/hour,
getFormSpecFromSpec mapped the missing field to an empty range array. On
save that serializes to an omitted field, and the server compiles an empty
second/minute/hour range to 'match nothing' (the server only fills the '0'
default for the deprecated string CalendarSpec, not a directly-supplied
StructuredCalendarSpec), so the edited schedule has no future runs.

Fall back to a 0 range for these fields, mirroring dayOfMonth/dayOfWeek/month.
@tegan-temporal tegan-temporal requested a review from a team as a code owner July 10, 2026 05:18
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Jul 10, 2026 5:20am

Request Review

// An absent second/minute/hour must default to 0, not an empty range.
// if we use an empty range, that tells the server to exclude everything
// and no future runs will occur.
hour: defaultMissingRangeStart(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.

calendar.hour ?? [{ start: 0, end: 0, step: 1 }],
0,
),
minute: defaultMissingRangeStart(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.

calendar.minute ?? [{ start: 0, end: 0, step: 1 }],
0,
),
second: defaultMissingRangeStart(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.

second: defaultMissingRangeStart(
calendar.second ?? [{ start: 0, end: 0, step: 1 }],
0,
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Type 'IRange[]' is not assignable to type '{ start: number; end?: number | undefined; step?: number | undefined; }[]'.

calendar.second ?? [{ start: 0, end: 0, step: 1 }],
0,
),
month: calendar.month ?? [{ start: 1, end: 12, step: 1 }],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Type 'IRange[] | null | undefined' is not assignable to type '{ start: number; end?: number | undefined; step?: number | undefined; }[] | undefined'.

@temporal-cicd

temporal-cicd Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

📊 Strict Mode: 9 errors in 1 file (1.0% of 893 total)

src/lib/components/schedule/utilities/get-form-spec.ts (9)
  • L23:8: Type 'IRange[]' is not assignable to type '{ start: number; end?: number | undefined; step?: number | undefined; }[]'.
  • L25:10: Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.
  • L32:10: Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.
  • L36:10: Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.
  • L40:10: Argument of type 'IRange[]' is not assignable to parameter of type '{ start?: number | undefined; end?: number | undefined; step?: number | undefined; }[]'.
  • L43:8: Type 'IRange[]' is not assignable to type '{ start: number; end?: number | undefined; step?: number | undefined; }[]'.
  • L44:8: Type 'IRange[] | null | undefined' is not assignable to type '{ start: number; end?: number | undefined; step?: number | undefined; }[] | undefined'.
  • L51:15: Argument of type '{ kind: "frozen"; interval: { interval: ${number}s; phase: ${number}s; }; }' is not assignable to parameter of type '{ calendar: { second: { start: number; end?: number | undefined; step?: number | undefined; }[]; minute: { start: number; end?: number | undefined; step?: number | undefined; }[]; hour: { start: number; end?: number | undefined; step?: number | undefined; }[]; ... 4 more ...; year?: { ...; }[] | undefined; }; cronSt...'.
  • L57:6: Type '{ kind: "frozen"; interval: { interval: ${number}s; phase: ${number}s; }; }' does not satisfy the expected type '{ calendar: { second: { start: number; end?: number | undefined; step?: number | undefined; }[]; minute: { start: number; end?: number | undefined; step?: number | undefined; }[]; hour: { start: number; end?: number | undefined; step?: number | undefined; }[]; ... 4 more ...; year?: { ...; }[] | undefined; }; cronSt...'.

Generated by 🚫 dangerJS against 89f031b

@tegan-temporal tegan-temporal enabled auto-merge (squash) July 10, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant