Repository navigation
fix(website): keep a one-shot job's run time when editing it - #25990
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design problem blocks this. It is a narrow, reversible frontend fix, the backend PATCH really does keep the schedule when neither Notes
[DESIGN-REVIEWED] c707213 Description read[DESCRIPTION-READ] 0bc2090eaff3edcb74442fd910e1e1b55f06013fe812c4f092189a8a81a453f7 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader correctly read the new read-only "at 09:00 AM PST, Nov 2" as one fixed run time, and shot-02 shows it. Notes
[UX-REVIEWED] c707213 Description read[DESCRIPTION-READ] 26228503f4acded9741e09ee7d62544a2ddd7ffda32b56c42db699528e699740 That sha256 names everything this verdict read: the PR description, plus the 5 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. It is a real fix for #25898, with tests that fail on base. Detecting a one-shot job from the start of the display text is fragile, but the API returns no Notes
What this change shipsInventory (3 items) — 3 justifiedIntent: let a person edit a one-time scheduled job's name, message or settings from the dashboard without the save failing or quietly turning it into a recurring job. FIX.
[FIRST-PRINCIPLES-REVIEWED] c707213 Description read[DESCRIPTION-READ] 3ea2c422ddb0d5ba283f33d89d3f9081d01d2bc20df43ce65fbac2b245546ca5 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
1cf04ca to
c707213
Compare
|
Rebased onto main (fe68d8e -> e106845) to pick up #25944. On the old head, Frontend Tests (1) failed in 🤖 AI-assisted comment 🤖 |
|
Review-ready on head 🤖 AI-assisted comment 🤖 |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the job edit form keeps a one-shot job's stored run time instead of failing on an empty cron field, with tests.
Problem / Motivation
Goal: A one-shot scheduled job can be opened and saved from the dashboard without losing its run time.
Opening a one-shot job (made with
at,at_timeordelay) shows the schedule as "Cron expression" with an empty field. Save then fails with "Enter a valid 5-field cron expression", even with no change. So the job's name, message or settings cannot be edited at all.Why it matters
Anyone with a one-time reminder cannot edit it from the dashboard. The form also shows the wrong schedule, so a user could "fix" it by typing a cron expression and turn a one-time reminder into a recurring job without meaning to.
Not a goal
What changed (motivation → approach → change)
Symptom: the edit form opens a one-shot job in cron mode with an empty field, and Save is refused.
Cause: the form only knew three modes (interval, weekly, cron). A one-shot job has neither an interval nor a cron expression, so it fell through to cron mode with nothing in it.
Change: the form now recognises a one-shot job (no interval, no cron expression, and the server's schedule text starts with
at). It shows that stored run time as plain text in place of the schedule picker. On Save it sends no schedule and no timezone. The update endpoint changes the schedule only whencronoreveryis sent, so the stored run time stays as it was.Decision: the most conservative fix. The run time is shown read-only rather than adding a new one-shot editor, which would need new copy in every locale and is #9836's scope.
Backwards compatibility
Compatible: interval, weekly and cron jobs parse and save exactly as before; only a job that matched none of them now gets its own mode.
Removes nothing: the form gains a display for one-shot jobs and no field, key or path is taken away.
Tests
website/src/test/JobForm.oneShot.test.tsx:cron,everyortimezone;updateCronwithout a schedule.All three fail on
origin/mainand pass with the fix. The nearbyJobForm.timeLimitandJobForm.scriptCommandsuites still pass, andtsc -p tsconfig.app.jsonis clean.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Built the form alone with stubbed API calls, loaded it in headless Chromium, and clicked Save on a one-shot job. Before the fix, Save is refused and the form shows an empty cron field. After the fix, the form shows "at 09:00 AM PST, Nov 2" and Save completes.
Screenshots / video
Before (cron mode, empty field; Save refused):
After (stored run time shown; Save completes):
Related Issues
Closes #25898
Sibling sweep
Swept: git grep -nE "schedMode|cron_expr || ''" -- website/src
Sibling: website/src/components/WeekGrid.tsx:84 -- not affected -- it only draws the week view and never builds a save body
Sibling: website/src/utils/schedulePresets.tsx -- not affected -- presets seed new jobs only, and a new job is never one-shot here
Pattern harvest
Rule candidate: review-prompt
Pattern: "an edit form that parses a stored record into a fixed set of modes must give each stored kind its own mode, not fall back to an empty editable one"
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)🤖 AI-assisted PR 🤖