From c89336da5ffa2e02082b3f9e3a8aff7044e00ef1 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 12 Oct 2026 16:51:03 +0200 Subject: [PATCH] fix: daily, weekly and monthly automations can run twice or skip their first run (#32264) Automations scheduled with the Daily, Weekly or Monthly picker ran a few seconds after the chosen time, taking the seconds from whenever the previous run was handled. Now and then that left the next run due again within the same minute, and the automation ran twice. Users whose timezone is behind the server's could also have their first run moved to the next day. These schedules now run at the exact minute chosen, in the user's own timezone. Fixes #32263 --- backend/open_webui/utils/recurrence.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/open_webui/utils/recurrence.py b/backend/open_webui/utils/recurrence.py index 717953cc6b..54efe0ec96 100644 --- a/backend/open_webui/utils/recurrence.py +++ b/backend/open_webui/utils/recurrence.py @@ -64,6 +64,9 @@ def _parse_rule(s: str, now: Optional[datetime] = None): }.get(rule._freq) if step is None: + # dateutil's default anchor carries seconds and the server timezone + if not has_dtstart: + return rrulestr(stripped, dtstart=anchor.replace(second=0, microsecond=0), ignoretz=True) if not rule._dtstart.tzinfo: return parsed return rrulestr(stripped, dtstart=start, ignoretz=True)