Skip to content

fix: scheduled pipes honor local timezone (#3851); clear-cache button label (#3589)#3862

Merged
louis030195 merged 2 commits into
mainfrom
claude/sad-hermann-8cdc09
Jun 5, 2026
Merged

fix: scheduled pipes honor local timezone (#3851); clear-cache button label (#3589)#3862
louis030195 merged 2 commits into
mainfrom
claude/sad-hermann-8cdc09

Conversation

@louis030195

Copy link
Copy Markdown
Collaborator

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 reads clear.

before:  [ Clear Cache ]                 ( scan )
after:   [ Clear Cache ]                 ( clear )

#3851 — scheduled pipes fired in UTC, not local time

Raw cron (0 7 * * *) was evaluated against Utc::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_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.

Tests (new, deterministic)

test pipes::tests::human_schedule_encodes_local_hour_not_utc ... ok
test pipes::tests::cron_fires_relative_to_scheduled_time ... ok
test pipes::tests::human_schedule_pm_hour_is_local ... ok
test result: ok. 3 passed; 0 failed

Follow-up (NOT in this PR)

While testing I found a separate, pre-existing bug: the cron crate v0.13 treats dow=1 as Sunday, but parse_human_schedule maps monday→1, so "every monday …" schedules currently fire on Sundays. Easy to fix with tests if wanted.

🤖 Generated with Claude Code

Louis Beaumont and others added 2 commits June 5, 2026 10:57
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>
@louis030195 louis030195 merged commit 46b5e58 into main Jun 5, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant