{"record":{"id":"d6adb21a09ca30cb","repo":"Hmbown/CodeWhale","slug":"byday-cannot-be-empty-for-weekly-schedules","errorCode":null,"errorMessage":"BYDAY cannot be empty for WEEKLY schedules","messagePattern":"BYDAY cannot be empty for WEEKLY schedules","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":431,"sourceCode":"                    byday,\n                    anchor_hour,\n                    anchor_minute,\n                })\n            }\n            AutomationFrequency::Weekly => {\n                for key in parts.keys() {\n                    if key != \"FREQ\" && key != \"BYDAY\" && key != \"BYHOUR\" && key != \"BYMINUTE\" {\n                        bail!(\n                            \"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                }","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L413-L449","documentation":"WEEKLY schedules require a non-empty BYDAY list naming which weekdays the automation runs. BYDAY is mandatory (missing BYDAY raises 'WEEKLY schedules require BYDAY'), and after parse_byday the result must contain at least one day, otherwise this error fires.","triggerScenarios":"Parsing 'RRULE:FREQ=WEEKLY;BYDAY=;BYHOUR=9;BYMINUTE=0' (empty value) or a BYDAY string whose tokens all fail to parse into days, leaving an empty vec.","commonSituations":"UI saving an empty weekday selection; config written with BYDAY= placeholder; unrecognized day tokens filtered out leaving nothing.","solutions":["Provide at least one valid day token in BYDAY (MO,TU,WE,TH,FR,SA,SU)","Fix the UI/config writer to refuse saving WEEKLY with no selected days","Check day-token spelling and separators against parse_byday's expected format"],"exampleFix":"// before\nRRULE:FREQ=WEEKLY;BYDAY=;BYHOUR=9;BYMINUTE=0\n// after\nRRULE:FREQ=WEEKLY;BYDAY=MO,WE;BYHOUR=9;BYMINUTE=0","handlingStrategy":"validation","validationCode":"const byday = (rule.match(/BYDAY=([^;]*)/)?.[1] ?? \"\").trim();\nconst days = byday.split(',').filter(d => [\"MO\",\"TU\",\"WE\",\"TH\",\"FR\",\"SA\",\"SU\"].includes(d.toUpperCase()));\nif (days.length === 0) throw new Error(\"WEEKLY schedules require at least one valid BYDAY value\");","typeGuard":"const isWeekday = (s: string): s is \"MO\"|\"TU\"|\"WE\"|\"TH\"|\"FR\"|\"SA\"|\"SU\" =>\n  [\"MO\",\"TU\",\"WE\",\"TH\",\"FR\",\"SA\",\"SU\"].includes(s.toUpperCase());","tryCatchPattern":"try {\n  parse_rrule(rule)?;\n} catch e if e.to_string().contains(\"BYDAY cannot be empty\") {\n  eprintln!(\"{e}; select at least one weekday\");\n}","preventionTips":["Require at least one selected weekday in weekly schedule forms","Never serialize BYDAY= with an empty value; omit the key only if required elsewhere","Validate day tokens (MO..SU) at input time"],"tags":["rrule","scheduling","validation","empty-value"],"backgroundTag":"empty-required-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"}