[PR #24640] fix: exact-time calendar alerts by adding scheduler grace window #131418

Open
opened 2026-05-21 16:52:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24640
Author: @code-quad3
Created: 5/13/2026
Status: 🔄 Open

Base: devHead: fix-calendar-at-time-alert


📝 Commits (1)

  • cb179dd Fix exact-time calendar alerts by adding scheduler grace window

📊 Changes

2 files changed (+4 additions, -2 deletions)

View changed files

📝 backend/open_webui/models/calendar.py (+2 -1)
📝 backend/open_webui/utils/automations.py (+2 -1)

📄 Description

Pull Request Checklist

  • Linked Issue/Discussion: Closes [PR #17888] [MERGED] fix: log web search queries only with level 'debug' instead of 'info' (#24589)
  • Target branch: dev
  • Description: Added scheduler grace window for exact-time calendar reminders.
  • Changelog: Added below.
  • Documentation: Not required (internal bug fix, no user-facing config change).
  • Dependencies: No new dependencies.
  • Testing: Manually tested exact-time and 5-minute reminders.
  • Agentic AI Code: Manually reviewed and tested.
  • Code review: Self-reviewed.
  • Design & Architecture: No architectural changes.
  • Git Hygiene: Atomic change, rebased on dev.
  • Title Prefix: fix

Changelog Entry

Description

Fixes a bug where calendar reminders configured as "At time of event" could be skipped when the scheduler polled slightly after the event start time.

Added

  • Grace window based on SCHEDULER_POLL_INTERVAL for exact-time reminder detection.

Changed

  • Updated calendar alert lookup logic to include recently-started events inside the scheduler polling window.

Deprecated

  • None

Removed

  • None

Fixed

  • "At time of event" reminders now trigger correctly for:

    • UI notifications
    • Webhook notifications

Security

  • None

Breaking Changes

  • None

Additional Information

Root cause:
get_upcoming_events() filtered only start_at >= now_ns, so if scheduler ran a few seconds late, the event was missed permanently.

Fix:
Allow a small backward grace window (now_ns - SCHEDULER_POLL_INTERVAL) during event lookup.

Screenshots or Videos

  • N/A (backend-only fix)

Contributor License Agreement

  • By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/24640 **Author:** [@code-quad3](https://github.com/code-quad3) **Created:** 5/13/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix-calendar-at-time-alert` --- ### 📝 Commits (1) - [`cb179dd`](https://github.com/open-webui/open-webui/commit/cb179ddc301e92d556fb0d7bc116199707897e72) Fix exact-time calendar alerts by adding scheduler grace window ### 📊 Changes **2 files changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/calendar.py` (+2 -1) 📝 `backend/open_webui/utils/automations.py` (+2 -1) </details> ### 📄 Description # Pull Request Checklist * [x] **Linked Issue/Discussion:** Closes #24589 * [x] **Target branch:** `dev` * [x] **Description:** Added scheduler grace window for exact-time calendar reminders. * [x] **Changelog:** Added below. * [x] **Documentation:** Not required (internal bug fix, no user-facing config change). * [x] **Dependencies:** No new dependencies. * [x] **Testing:** Manually tested exact-time and 5-minute reminders. * [x] **Agentic AI Code:** Manually reviewed and tested. * [x] **Code review:** Self-reviewed. * [x] **Design & Architecture:** No architectural changes. * [x] **Git Hygiene:** Atomic change, rebased on `dev`. * [x] **Title Prefix:** `fix` # Changelog Entry ### Description Fixes a bug where calendar reminders configured as **"At time of event"** could be skipped when the scheduler polled slightly after the event start time. ### Added * Grace window based on `SCHEDULER_POLL_INTERVAL` for exact-time reminder detection. ### Changed * Updated calendar alert lookup logic to include recently-started events inside the scheduler polling window. ### Deprecated * None ### Removed * None ### Fixed * "At time of event" reminders now trigger correctly for: * UI notifications * Webhook notifications ### Security * None ### Breaking Changes * None --- ### Additional Information Root cause: `get_upcoming_events()` filtered only `start_at >= now_ns`, so if scheduler ran a few seconds late, the event was missed permanently. Fix: Allow a small backward grace window (`now_ns - SCHEDULER_POLL_INTERVAL`) during event lookup. ### Screenshots or Videos * N/A (backend-only fix) ### Contributor License Agreement * [x] By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 16:52:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#131418