Allow arming never-run one-shot routines - #327
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughChangesOne-shot routine arming
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Editor as Routine editor
participant API as routines.update
participant Router as API router
participant State as Routine state
Editor->>API: Submit future runAt
API->>Router: Validate update input
Router->>State: Set active and nextRunAt
State-->>Editor: Return updated routine
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Playwright screenshotsOpen screenshot gallery · Dashboard · CI run Updated for commit |
f22046e to
bbbaf5e
Compare
Treat @once as already-fired only when lastRunAt is set. Arm with optional runAt on routines.update, and expose a Run at field in the web routine panel. Co-authored-by: Elie Steinbock <elie222@users.noreply.github.com>
bbbaf5e to
b993bca
Compare
|
Keeping this as draft on purpose. Do not mark ready or merge until Elie asks. Share was reverted; this is only the once-arm fix. |
Greptile SummaryThis PR restores support for arming inactive, never-run one-shot routines with a future execution time.
|
| Filename | Overview |
|---|---|
| apps/api/src/router.ts | Adds validation and scheduling for arming never-run one-shots with a future timestamp. |
| apps/web/src/pages/Shell.tsx | Adds the one-shot arming UI, but its save payload also unintentionally activates inactive recurring routines. |
| packages/contracts/src/rpc.ts | Extends routine updates with an optional ISO-formatted runAt field. |
| packages/testkit/src/journeys.test.ts | Covers one-shot arming and post-execution rejection, but not preservation of inactive recurring routines during edits. |
Reviews (1): Last reviewed commit: "Allow arming never-run one-shot routines..." | Re-trigger Greptile
Re-lands only the
@onceenable fix that was lost when share (#302) was reverted.Why: After the accidental share merge and revert (#326), Greptile correctly noted that never-fired inactive one-shots again cannot be activated (
!nextRunAtwas treated as already-fired).What:
routines.updatetreats already-fired only whenlastRunAtis setrunAtarms never-run one-shotsactive+runAton saveNo share feature in this PR.
Do not auto-merge. Leave for Elie to decide.
Summary by CodeRabbit
New Features
Bug Fixes