Skip to content

fix(schedules): default emptied second/minute/hour to 0 on submit#3655

Merged
tegan-temporal merged 3 commits into
mainfrom
DT-4249-default-second-minute-hour-on-create
Jul 10, 2026
Merged

fix(schedules): default emptied second/minute/hour to 0 on submit#3655
tegan-temporal merged 3 commits into
mainfrom
DT-4249-default-second-minute-hour-on-create

Conversation

@tegan-temporal

Copy link
Copy Markdown
Contributor

Follow-up to #3653.

Problem

That PR fixed the edit-load path, but the same "empty range → server matches nothing → no future runs" hazard exists on create: the zod schema only defaults second/minute/hour when they're undefined, so an emptied calendar time field (e.g. a cleared picker) slips through as [].

Fix

Guard the single submit choke point (toStructuredCalendar) so an empty second/minute/hour range defaults to 0. Covers create and edit. Test added.

Guard the request builder so an emptied calendar time field (possible on
create, not just when loading an existing schedule) never emits an empty
range, which the server compiles to 'match nothing'.
@tegan-temporal
tegan-temporal requested a review from a team as a code owner July 10, 2026 16:15
@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 4:40pm

Request Review

],
}),
);

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.

  • ⚠️ 'body.schedule.spec' is possibly 'undefined'.
  • ⚠️ Type 'IStructuredCalendarSpec[] | null | undefined' must have a 'Symbol.iterator' method that returns an iterator.


it('anchors the start time to midnight of the timezone', async () => {
const body = await getRequestBody(buildForm());

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.

  • ⚠️ 'body.schedule.spec' is possibly 'undefined'.

@temporal-cicd

temporal-cicd Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

📊 Strict Mode: 40 errors in 2 files (4.5% of 895 total)

src/lib/components/schedule/utilities/get-request-body.ts (5)
  • L36:47: Property 'action' does not exist on type '(ISchedule & Omit<ISchedule, "spec"> & { spec?: ScheduleSpecResponse | null | undefined; }) | undefined'.
  • L104:4: 'describeFullSchedule.schedule' is possibly 'undefined'.
  • L175:49: Property 'spec' does not exist on type '(ISchedule & Omit<ISchedule, "spec"> & { spec?: ScheduleSpecResponse | null | undefined; }) | undefined'.
  • L207:49: Property 'spec' does not exist on type '(ISchedule & Omit<ISchedule, "spec"> & { spec?: ScheduleSpecResponse | null | undefined; }) | undefined'.
  • L308:4: Type '{ indexedFields: { indexedFields?: { [k: string]: IPayload; } | null | undefined; }; } | null' is not assignable to type 'ISearchAttributes | null | undefined'.
src/lib/components/schedule/utilities/get-request-body.test.ts (35)
  • L28:11: 'body.schedule.action' is possibly 'undefined'.
  • L31:11: 'body.schedule.action' is possibly 'undefined'.
  • L34:11: 'body.schedule.action' is possibly 'undefined'.
  • L51:11: 'body.schedule.spec' is possibly 'undefined'.
  • L60:11: 'body.schedule.spec' is possibly 'undefined'.
  • L70:11: 'body.schedule.spec' is possibly 'undefined'.
  • L84:11: 'body.schedule.spec' is possibly 'undefined'.
  • L85:11: 'body.schedule.spec' is possibly 'undefined'.
  • L85:11: 'body.schedule.spec.structuredCalendar' is possibly 'null' or 'undefined'.
  • L107:10: Type 'IStructuredCalendarSpec[] | null | undefined' must have a 'Symbol.iterator' method that returns an iterator.
  • L107:23: 'body.schedule.spec' is possibly 'undefined'.
  • L116:11: 'body.schedule.spec' is possibly 'undefined'.
  • L117:11: 'body.schedule.spec' is possibly 'undefined'.
  • L122:11: 'body.schedule.spec' is possibly 'undefined'.
  • L130:11: 'body.schedule.spec' is possibly 'undefined'.
  • L138:11: 'body.schedule.state' is possibly 'undefined'.
  • L139:11: 'body.schedule.state' is possibly 'undefined'.
  • L145:11: 'body.schedule.state' is possibly 'undefined'.
  • L146:11: 'body.schedule.state' is possibly 'undefined'.
  • L151:11: 'withJitter.schedule.spec' is possibly 'undefined'.
  • L154:11: 'withoutJitter.schedule.spec' is possibly 'undefined'.
  • L162:11: 'body.schedule.policies' is possibly 'undefined'.
  • L163:11: 'body.schedule.action' is possibly 'undefined'.
  • L169:12: Property 'startWorkflow' does not exist on type 'ScheduleActionRequest | undefined'.
  • L184:12: Property 'startWorkflow' does not exist on type 'ScheduleActionRequest | undefined'.
  • L199:11: 'body.schedule.policies' is possibly 'undefined'.
  • L200:11: 'body.schedule.policies' is possibly 'undefined'.
  • L205:11: 'body.schedule.state' is possibly 'undefined'.
  • L224:13: 'body.schedule.spec' is possibly 'undefined'.
  • L227:13: 'body.schedule.spec' is possibly 'undefined'.
  • L236:13: 'body.schedule.spec' is possibly 'undefined'.
  • L245:13: 'body.schedule.spec' is possibly 'undefined'.
  • L255:13: 'body.schedule.spec' is possibly 'undefined'.
  • L264:13: 'body.schedule.spec' is possibly 'undefined'.
  • L273:13: 'body.schedule.spec' is possibly 'undefined'.

Generated by 🚫 dangerJS against 4af6138

@tegan-temporal tegan-temporal self-assigned this Jul 10, 2026
Comment thread src/lib/components/schedule/utilities/get-request-body.ts Outdated
@tegan-temporal
tegan-temporal enabled auto-merge (squash) July 10, 2026 16:42
@tegan-temporal
tegan-temporal merged commit 508b65b into main Jul 10, 2026
17 checks passed
@tegan-temporal
tegan-temporal deleted the DT-4249-default-second-minute-hour-on-create branch July 10, 2026 16:49
rossedfort added a commit that referenced this pull request Jul 13, 2026
Auto-generated version bump from 2.52.0 to 2.52.1

Bump type: patch

Changes included:
- [`3be0df00`](3be0df0) fix(schedules): default absent second/minute/hour to 0 when editing (#3653)
- [`508b65b7`](508b65b) fix(schedules): default emptied second/minute/hour to 0 on submit (#3655)
- [`1f0e149c`](1f0e149) fix(workers): reject $LATEST qualifier in Lambda ARN validation (#3657)
- [`b42b0776`](b42b077) a11y(2.4.3): inert-based focus containment + restore; drop trap from native dialogs (#3598)
- [`cc491a29`](cc491a2) a11y(2.4.3): keep toast live region announcing during a focus trap [DT-4252] (#3654)
- [`ddc7f8e2`](ddc7f8e) a11y(2.4.11): add scroll-padding so sticky overlays don't obscure focused elements (#3532)
- [`b7e3a472`](b7e3a47) FilterBar icon update (#3660)
- [`09318ec6`](09318ec) Add danger PR comment for api version bump (#3662)
- [`273cc4be`](273cc4b) a11y(4.1.2): add label prop to Button primitive and enforce accessible names (#3556)
- [`4507115f`](4507115) Use an editable combobox for the Cloud Run region field (DT-4232) (#3636)
- [`694a7471`](694a747) a11y(1.4.13): migrate saved-query nav tooltips to Tooltip primitive (#3607)
- [`8b384a40`](8b384a4) a11y(4.1.2): fix nested interactive elements in Copyable component (#3558)
- [`1bfd2750`](1bfd275) fix describe SANO API requests to include runId parameter (#3661)
- [`ba18b43e`](ba18b43) a11y(4.1.2): require label on CodeBlock primitive; add aria-readonly for read-only mode (#3557)
- [`6e2290f1`](6e2290f) feat(deployments): make compute provider picker configurable (#3659)
- [`4470b76a`](4470b76) fix(workers): persist WDV compute-config edits via update mask; revert $LATEST validation (#3658)
- [`17fd591b`](17fd591) fix(nexus-operations): make start standalone nexus operation timeouts optional (#3656)

Co-authored-by: rossedfort <[email protected]>
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.

2 participants