{"record":{"id":"8ddb96781d5eb133","repo":"Hmbown/CodeWhale","slug":"unsupported-rrule-field-key-for-once-allowed","errorCode":null,"errorMessage":"Unsupported RRULE field '{key}' for ONCE. Allowed: FREQ,AT","messagePattern":"Unsupported RRULE field '(.+?)' for ONCE\\. Allowed: FREQ,AT","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":602,"sourceCode":"            \"TU\" => Weekday::Tue,\n            \"WE\" => Weekday::Wed,\n            \"TH\" => Weekday::Thu,\n            \"FR\" => Weekday::Fri,\n            \"SA\" => Weekday::Sat,\n            \"SU\" => Weekday::Sun,\n            other => bail!(\"Invalid BYDAY value '{other}'\"),\n        };\n        if !days.contains(&day) {\n            days.push(day);\n        }\n    }\n    Ok(days)\n}\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())","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/automation_manager.rs#L584-L620","documentation":"parse_once_schedule rejects any RRULE key other than FREQ and AT for FREQ=ONCE. Keys are uppercased before the check, so it is case-insensitive; only extraneous fields trigger this error (a missing AT produces 'ONCE schedules require AT' instead).","triggerScenarios":"AutomationSchedule::parse_rrule(\"FREQ=ONCE;AT=2026-08-03T14:30;BYDAY=MO\"), or FREQ=ONCE;INTERVAL=2;AT=... — any key beyond FREQ/AT.","commonSituations":"Converting a recurring rrule to ONCE and leaving INTERVAL/BYDAY behind; pasting full iCalendar RRULEs containing COUNT, UNTIL, or DTSTART.","solutions":["Strip all keys except FREQ and AT for one-shot schedules","Express recurrence with FREQ=HOURLY, WEEKLY, or CRON instead of extra ONCE fields","Keep the fire time solely in AT (RFC3339 or local naive format)","Dry-run parse_rrule on the final string before saving"],"exampleFix":"// before\nrrule = \"FREQ=ONCE;AT=2026-08-03T14:30;INTERVAL=1\"\n\n// after\nrrule = \"FREQ=ONCE;AT=2026-08-03T14:30\"","handlingStrategy":"validation","validationCode":"fn valid_once_rrule(rrule: &str) -> bool {\n    rrule.split(';')\n        .filter_map(|s| s.split_once('=').map(|(k, _)| k.trim().to_ascii_uppercase()))\n        .all(|k| k == \"FREQ\" || k == \"AT\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build ONCE rrules from a single AT timestamp plus FREQ","Reject extra keys client-side before calling create_automation","Remember keys are case-insensitive; values are not normalized","Use FREQ=CRON or HOURLY when recurrence is actually needed"],"tags":["rust","rrule","once","validation"],"backgroundTag":"rrule-unsupported-field","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}