{"record":{"id":"fa3bd608ba343a4d","repo":"Hmbown/CodeWhale","slug":"unsupported-rrule-field-key-for-cron-allowed","errorCode":null,"errorMessage":"Unsupported RRULE field '{key}' for CRON. Allowed: FREQ,EXPR","messagePattern":"Unsupported RRULE field '(.+?)' for CRON\\. Allowed: FREQ,EXPR","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":714,"sourceCode":"}\n\nfn parse_once_schedule(parts: &BTreeMap<String, String>) -> Result<AutomationSchedule> {\n    for key in parts.keys() {\n        if key != \"FREQ\" && key != \"AT\" {\n            bail!(\"Unsupported RRULE field '{key}' for ONCE. Allowed: FREQ,AT\");\n        }\n    }\n    let raw_at = parts\n        .get(\"AT\")\n        .ok_or_else(|| anyhow::anyhow!(\"ONCE schedules require AT\"))?;\n    let at = parse_once_at(raw_at)?;\n    Ok(AutomationSchedule::Once { at })\n}\n\nfn parse_cron_schedule(parts: &BTreeMap<String, String>) -> Result<AutomationSchedule> {\n    for key in parts.keys() {\n        if key != \"FREQ\" && key != \"EXPR\" {\n            bail!(\"Unsupported RRULE field '{key}' for CRON. Allowed: FREQ,EXPR\");\n        }\n    }\n    let expr = parts\n        .get(\"EXPR\")\n        .map(|value| value.trim().to_string())\n        .filter(|value| !value.is_empty())\n        .ok_or_else(|| anyhow::anyhow!(\"CRON schedules require EXPR\"))?;\n    ParsedCronExpr::parse(&expr)?;\n    Ok(AutomationSchedule::Cron { expr })\n}\n\nfn parse_once_at(raw: &str) -> Result<DateTime<Utc>> {\n    let trimmed = raw.trim();\n    if let Ok(at) = DateTime::parse_from_rfc3339(trimmed) {\n        return Ok(at.with_timezone(&Utc));\n    }\n    for format in [\"%Y-%m-%dT%H:%M:%S\", \"%Y-%m-%dT%H:%M\"] {\n        if let Ok(naive) = NaiveDateTime::parse_from_str(trimmed, format) {","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L696-L732","documentation":"parse_cron_schedule whitelists the RRULE keys allowed for a CRON schedule: only FREQ and EXPR. Any other key bails with this message naming the allowed set. This rejects, for example, BYDAY or INTERVAL on a cron schedule, since cron semantics are fully expressed by the five-field EXPR.","triggerScenarios":"AutomationSchedule::parse with FREQ=CRON plus any key besides EXPR — e.g. FREQ=CRON;EXPR=\"0 9 * * *\";BYDAY=MO or a leftover AT field from a ONCE schedule.","commonSituations":"Migrating a schedule between ONCE and CRON and forgetting to drop the old field; appending iCalendar-style fields to a cron RRULE.","solutions":["Keep only FREQ and EXPR in the CRON RRULE; encode day/hour restrictions inside the five-field EXPR.","Remove leftover ONCE (AT) or recurring (BYDAY/INTERVAL) fields.","Use FREQ=WEEKLY if you want the RRULE-style fields instead of cron syntax."],"exampleFix":"// before\nFREQ=CRON;EXPR=\"0 9 * * *\";BYDAY=MO\n// after\nFREQ=CRON;EXPR=\"0 9 * * 1\"","handlingStrategy":"validation","validationCode":"const CRON_KEYS: [&str; 2] = [\"FREQ\", \"EXPR\"];\nif !parts.keys().all(|k| CRON_KEYS.contains(&k.as_str())) {\n    return Err(\"CRON schedules allow only FREQ and EXPR\");\n}","typeGuard":null,"tryCatchPattern":"match AutomationSchedule::parse(rrule) {\n    Ok(s) => save(s),\n    Err(e) if e.to_string().contains(\"for CRON\") => strip_unknown_fields_and_retry(),\n    Err(e) => report(e),\n}","preventionTips":["Encode day/hour restrictions inside the cron EXPR, never as extra RRULE fields.","When migrating ONCE→CRON, remove the AT field.","Validate the RRULE key set per FREQ value before persisting."],"tags":["validation","rrule","cron"],"backgroundTag":"unsupported-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}