{"record":{"id":"d1d5137c0eeecfd2","repo":"Hmbown/CodeWhale","slug":"interval-must-be-1-for-hourly-schedules","errorCode":null,"errorMessage":"INTERVAL must be >= 1 for HOURLY schedules","messagePattern":"INTERVAL must be >= 1 for HOURLY schedules","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":389,"sourceCode":"                    if key != \"FREQ\"\n                        && key != \"INTERVAL\"\n                        && key != \"BYDAY\"\n                        && key != \"BYHOUR\"\n                        && key != \"BYMINUTE\"\n                    {\n                        bail!(\n                            \"Unsupported RRULE field '{key}' for HOURLY. Allowed: FREQ,INTERVAL,BYDAY,BYHOUR,BYMINUTE\"\n                        );\n                    }\n                }\n                let interval_hours = parts\n                    .get(\"INTERVAL\")\n                    .map(|v| v.parse::<u32>())\n                    .transpose()\n                    .context(\"Failed to parse INTERVAL\")?\n                    .unwrap_or(1);\n                if interval_hours == 0 {\n                    bail!(\"INTERVAL must be >= 1 for HOURLY schedules\");\n                }\n                let byday = parts\n                    .get(\"BYDAY\")\n                    .map(|value| parse_byday(&value.to_ascii_uppercase()))\n                    .transpose()?;\n                let anchor_hour = parts\n                    .get(\"BYHOUR\")\n                    .map(|value| value.parse::<u32>())\n                    .transpose()\n                    .context(\"Failed to parse BYHOUR\")?;\n                let anchor_minute = parts\n                    .get(\"BYMINUTE\")\n                    .map(|value| value.parse::<u32>())\n                    .transpose()\n                    .context(\"Failed to parse BYMINUTE\")?;\n                if anchor_hour.is_some_and(|hour| hour > 23) {\n                    bail!(\"BYHOUR must be between 0 and 23\");\n                }","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L371-L407","documentation":"HOURLY schedules accept an INTERVAL that shifts the run every N hours; an INTERVAL of 0 would never advance and is rejected. The parser parses INTERVAL as u32 and enforces >= 1 (1 being the default when omitted).","triggerScenarios":"Parsing 'RRULE:FREQ=HOURLY;INTERVAL=0' — u32 parse succeeds with value 0 and the explicit zero check bails.","commonSituations":"Config templating that substitutes an unset variable as 0; user thinking INTERVAL=0 means 'every hour'.","solutions":["Set INTERVAL to 1 or greater (omit it entirely for every hour)","Fix template/variable substitution so empty values don't become 0","Validate INTERVAL > 0 before writing the automation config"],"exampleFix":"// before\nRRULE:FREQ=HOURLY;INTERVAL=0\n// after\nRRULE:FREQ=HOURLY;INTERVAL=1","handlingStrategy":"validation","validationCode":"const interval = Number(rule.match(/INTERVAL=(\\d+)/)?.[1] ?? 1);\nif (interval < 1) throw new Error(\"INTERVAL must be >= 1 for HOURLY schedules\");","typeGuard":null,"tryCatchPattern":"try {\n  parse_rrule(rule)?;\n} catch e if e.to_string().contains(\"INTERVAL must be >= 1\") {\n  eprintln!(\"{e}; defaulting to INTERVAL=1\");\n}","preventionTips":["Use a numeric spinner with min=1 in schedule forms","Treat missing INTERVAL as 1 and reject explicit 0 at input time","Guard template variables so unset values never render as 0"],"tags":["rrule","scheduling","range-check"],"backgroundTag":"value-out-of-range","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"}