Skip to content

Validate cron expressions at save time so invalid schedules fail loudly #1508

Closed

Description

@malibio

Overview

Playbook cron expressions are stored without being parsed. An invalid or wrong-field-count cron passes the save gate, activates, and then silently never fires — the failure is invisible to the user. Also: a poisoned lock in the cron poll loop panics the loop permanently.

Problem Statement

parse_trigger stores the cron string and the validator never parses it, so bad crons activate and never run. Separately, the cron poll loop unwraps a lock that, once poisoned, permanently stops the runner.

Proposed Solution

Call cron::Schedule::from_str in the validator and reject invalid schedules at save time. Handle the poisoned-lock case in the poll loop without permanently killing the runner.

Acceptance Criteria

  • Invalid cron expressions are rejected at save time with a clear error
  • A poisoned lock does not permanently stop the cron runner
  • Code passes bun run quality:fix; tests pass

Technical Specifications

Reference Files

  • packages/core/src/playbook/types.rs (parse_trigger), validation.rs, cron_runner.rs (~81 lock unwrap)

Related Issues

  • (none)

Activity

  1. added
    bug
    on Jul 5, 2026
  2. malibio commented on Jul 6, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 148 test files passed, 3963 tests passed.

  3. self-assigned this
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugrust

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions