fix: scheduled pipes honor local timezone (#3851); clear-cache button label (#3589)#3862
Merged
Conversation
The button under the Clear Cache card read "scan", which is confusing. It initiates the clear-cache flow, so label it "clear". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Raw cron schedules were resolved against Utc::now(), so "0 7 * * *" fired at 07:00 UTC instead of 07:00 local. The "every day at Nam" UI path worked around this by pre-shifting the hour to UTC at parse time (local_hour_to_utc), which was fragile (DST, parse-time offset). Now both paths interpret schedules in local time: parse_human_schedule encodes the local hour directly, and should_run evaluates via a new generic cron_should_fire(.., Local::now()) that preserves the catch-up/grace window. Added deterministic unit tests. Note: discovered (separate, not fixed here) that the cron crate v0.13 treats dow=1 as Sunday while parse_human_schedule maps monday->1, so "every monday" schedules land on Sunday. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes two bugs from the tracker, both verified locally on macOS.
Fixes #3589
Fixes #3851
#3589 — clear-cache button mislabeled
The button under the Clear Cache card read
scan. It starts the clear flow, so it now readsclear.#3851 — scheduled pipes fired in UTC, not local time
Raw cron (
0 7 * * *) was evaluated againstUtc::now(), so it fired at 07:00 UTC. The "every day at Nam" UI path worked around this by pre-shifting the hour to UTC at parse time (local_hour_to_utc), which was fragile (DST, parse-time offset).Now both paths interpret schedules in local time:
parse_human_scheduleencodes the local hour directly, andshould_runevaluates via a new genericcron_should_fire(.., Local::now())that preserves the catch-up / grace window.Tests (new, deterministic)
Follow-up (NOT in this PR)
While testing I found a separate, pre-existing bug: the
croncrate v0.13 treatsdow=1as Sunday, butparse_human_schedulemapsmonday→1, so "every monday …" schedules currently fire on Sundays. Easy to fix with tests if wanted.🤖 Generated with Claude Code