{"record":{"id":"7a18864423dd4592","repo":"Hmbown/CodeWhale","slug":"byminute-must-be-between-0-and-59","errorCode":null,"errorMessage":"BYMINUTE must be between 0 and 59","messagePattern":"BYMINUTE must be between 0 and 59","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":409,"sourceCode":"                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                }\n                if anchor_minute.is_some_and(|minute| minute > 59) {\n                    bail!(\"BYMINUTE must be between 0 and 59\");\n                }\n                Ok(Self::Hourly {\n                    interval_hours,\n                    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\")","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L391-L427","documentation":"Range guard in the RRULE parser: after BYMINUTE parses as an integer, its value is checked against the 0..=59 minute domain before a WEEKLY/DAILY schedule is accepted. It fires when the BYMINUTE token is numeric but out of range (e.g. BYMINUTE=75). Non-numeric or missing values produce different errors.","triggerScenarios":"Parsing 'RRULE:FREQ=HOURLY;BYMINUTE=60' or 'BYMINUTE=90'.","commonSituations":"Users entering 60 for 'top of the hour'; seconds confused for minutes; arithmetic producing values > 59.","solutions":["Use BYMINUTE between 0 and 59 (top of the hour is 0)","Validate the minute field before persisting the schedule","Omit BYMINUTE to use the default"],"exampleFix":"// before\nRRULE:FREQ=HOURLY;BYMINUTE=60\n// after\nRRULE:FREQ=HOURLY;BYMINUTE=0","handlingStrategy":"validation","validationCode":"const m = rule.match(/BYMINUTE=(\\d+)/);\nif (m && Number(m[1]) > 59) throw new Error(\"BYMINUTE must be between 0 and 59\");","typeGuard":"function isValidMinute(m: number): boolean { return Number.isInteger(m) && m >= 0 && m <= 59; }","tryCatchPattern":"try {\n  parse_rrule(rule)?;\n} catch e if e.to_string().contains(\"BYMINUTE must be between 0 and 59\") {\n  eprintln!(\"{e}; use 0-59\");\n}","preventionTips":["Constrain minute inputs to 0-59 in the UI","Never write seconds into BYMINUTE","Carry overflow minutes into the hour instead of storing >59"],"tags":["rrule","scheduling","range-check","time"],"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"}