mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
Both schedule parsers built their cron definition with cron-utils' default day-of-week field, which is Unix numbering: 0-6 for SUN-SAT. AWS numbers that field 1-7 for SUN-SAT, so every numeric day was read one day late and Saturday could not be expressed at all. cron(0 12 ? * 2 *) is Monday to AWS and fired on Tuesday. AWS's own documented example cron(15 10 ? * 6L 2022-2023), the last Friday of the month, fired on the last Saturday. cron(0 12 ? * 7 *) did not parse at all, failing with "Value 7 not in range [0, 6]". Day names were always correct, because cron-utils resolves them against its own numbering, so only expressions written with numbers were wrong. The definitions are at ScheduleExpressionParser.java:32 (eventbridge) and SchedulerExpressionParser.java:55 (scheduler). Both now pin the field with withValidRange(1, 7) and withMondayDoWValue(2), the same shape cron-utils uses for Quartz, whose day-of-week dialect AWS follows. 7 parses as Saturday, and 0 is rejected in line with AWS's documented 1-7 range. The existing eventbridge test getNextFireTimeFirstMondayOfMonth encoded the old behavior: it parsed cron(30 2 ? * 2#1 *), named itself for the first Monday, then asserted the fire day was a Tuesday. It now asserts 2026-03-02, which is the first Monday of that month.