{"record":{"id":"9fe00bfc03853f5a","repo":"Hmbown/CodeWhale","slug":"weekly-schedules-require-byminute","errorCode":null,"errorMessage":"WEEKLY schedules require BYMINUTE","messagePattern":"WEEKLY schedules require BYMINUTE","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":440,"sourceCode":"                            \"Unsupported RRULE field '{key}' for WEEKLY. Allowed: FREQ,BYDAY,BYHOUR,BYMINUTE\"\n                        );\n                    }\n                }\n                let byday_raw = parts\n                    .get(\"BYDAY\")\n                    .ok_or_else(|| anyhow::anyhow!(\"WEEKLY schedules require BYDAY\"))?;\n                let byday = parse_byday(&byday_raw.to_ascii_uppercase())?;\n                if byday.is_empty() {\n                    bail!(\"BYDAY cannot be empty for WEEKLY schedules\");\n                }\n                let byhour = parts\n                    .get(\"BYHOUR\")\n                    .ok_or_else(|| anyhow::anyhow!(\"WEEKLY schedules require BYHOUR\"))?\n                    .parse::<u32>()\n                    .context(\"Failed to parse BYHOUR\")?;\n                let byminute = parts\n                    .get(\"BYMINUTE\")\n                    .ok_or_else(|| anyhow::anyhow!(\"WEEKLY schedules require BYMINUTE\"))?\n                    .parse::<u32>()\n                    .context(\"Failed to parse BYMINUTE\")?;\n\n                if byhour > 23 {\n                    bail!(\"BYHOUR must be between 0 and 23\");\n                }\n                if byminute > 59 {\n                    bail!(\"BYMINUTE must be between 0 and 59\");\n                }\n\n                Ok(Self::Weekly {\n                    byday,\n                    byhour,\n                    byminute,\n                })\n            }\n        }\n    }","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L422-L458","documentation":"RRULE parse guard for WEEKLY frequency: BYDAY parsed successfully but the parts map has no BYMINUTE key. The minute component of the weekly anchor time is mandatory, so the schedule is rejected before an AutomationSchedule is built.","triggerScenarios":"A WEEKLY RRULE such as 'FREQ=WEEKLY;BYDAY=TU;BYHOUR=14' without BYMINUTE, or BYMINUTE present but non-numeric (which fails at the adjacent parse with context 'Failed to parse BYMINUTE').","commonSituations":"Author assuming minute defaults to 0, schedules converted from cron (where minutes are the first field and easily omitted when translating), tooling generating RRULEs without time components.","solutions":["Add BYMINUTE to the RRULE, e.g. FREQ=WEEKLY;BYDAY=TU;BYHOUR=14;BYMINUTE=0","Ensure BYMINUTE is an integer 0-59","Regenerate the schedule via the automation UI/CLI which composes the full RRULE"],"exampleFix":"// before\n\"FREQ=WEEKLY;BYDAY=TU;BYHOUR=14\"\n// after\n\"FREQ=WEEKLY;BYDAY=TU;BYHOUR=14;BYMINUTE=0\"","handlingStrategy":"validation","validationCode":"fn validate_byminute(rule: &str) -> Result<(), String> {\n    let parts: HashMap<_,_> = rule.split(';').filter_map(|p| p.split_once('=')).collect();\n    if parts.get(\"FREQ\").map(String::as_str) != Some(\"WEEKLY\") { return Ok(()); }\n    let m: u32 = parts.get(\"BYMINUTE\").ok_or(\"WEEKLY requires BYMINUTE\")?.parse().map_err(|_| \"BYMINUTE not numeric\")?;\n    if m > 59 { return Err(\"BYMINUTE must be 0-59\".into()); }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match parse_rrule(&rule) {\n    Ok(s) => save(s),\n    Err(e) if e.to_string().contains(\"require BYMINUTE\") =>\n        eprintln!(\"Add BYMINUTE (0-59) to your WEEKLY rule\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Always include BYMINUTE when converting cron or iCal times","Validate minute 0-59 before saving","Prefer structured {day, hour, minute} config over raw RRULE strings","Test round-trip: save then reload the schedule to confirm it parses"],"tags":["automation","rrule","scheduling","validation"],"backgroundTag":"missing-required-config-field","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"}