Inspiration

Rerun is an open source app you can run on your own server, with digital coworkers that work through your tools on a timetable. Reading its scheduling code, I noticed that a routine's timezone was accepted as any text. Real names like Europe/Paris worked, but so did Eastern and Europe/Pariss, which the scheduling library can't use. I reported it as issue #21.

What it does

rerun-build/rerun#22 changes Rerun's engine in two ways:

  • A routine whose next run can't be computed, because of an unknown timezone or a cron expression that doesn't parse, is never due and shows no next run. The scheduler keeps checking every other routine, and schedule_list and schedule_get keep working.
  • An unknown timezone is refused when a routine is created or updated, by the coworker's tools (with a message naming the value) and by the web routes (with a 400 error). An empty timezone still means none.

How I built it

Rerun uses croner for cron schedules. croner accepts any timezone text when a schedule is built and only throws when a run is computed. I wrapped that call in one helper, nextCronRun, which returns null instead of throwing, and pointed isDue and nextRunAt at it.

For the check on save, I let croner decide:

new Cron('* * * * *', { timezone }).nextRun()

isValidTimezone returns true if that works and false if it throws, and sits next to the existing cron and run time checks in the tools and routes.

Challenges I ran into

Choosing how to validate. A fixed list of timezone names would drift away from what croner and the platform accept. Asking croner directly keeps the check and the scheduler in agreement, including aliases such as UTC.

Being exact about impact. The scheduler loop had no try around the croner call, and the tick runs as void tick() with no unhandled rejection handler, so Node's default would end the process. I confirmed croner's error with the repo's croner 10.0.1 but didn't run a full self hosted stack, so the report says the exit follows from the code.

Accomplishments that I'm proud of

Every new test fails on main without the fix: timezone acceptance and rejection, routines that can't be computed, tool refusals that save nothing, and the two route errors. The engine's full test run passed, and ClementJanssens merged the PR on 6 November 2026 and summarised the fix on the issue.

What I learned

A library that validates late can still do the early validation for you, if you ask it the same question up front. And a loop that serves many users should treat one bad entry as a skip, the way Rerun's web interface already did.

What's next

Nothing is pending from this PR. Routines saved with a bad timezone before the fix will simply show no next run until someone corrects them.

The full story, with all the code, is on my blog: https://ashokramsi.hashnode.dev/rerun-timezone-routines

Built With

Share this project:

Updates