Merge pull request #6890 from redpersongpt/codex/checkin-calendar-window-boundaries

fix(checkin): avoid duplicate calendar events at window boundaries
This commit is contained in:
Alexandre Teixeira
2026-10-30 19:43:18 +00:00
committed by GitHub
2 changed files with 45 additions and 4 deletions
+2 -2
View File
@@ -326,7 +326,7 @@ def _digest_windows(now):
def _checkin_calendar_events(db, owner, start, end):
"""Calendar events in [start, end] for ONE owner, for the check-in digest.
"""Calendar events in [start, end) for ONE owner, for the check-in digest.
Ownership lives on CalendarCal.owner; events inherit it via calendar_id.
The digest query had no owner scope, so it pulled EVERY user's events into
@@ -340,7 +340,7 @@ def _checkin_calendar_events(db, owner, start, end):
.filter(
_CC.owner == owner,
_CE.dtstart >= start,
_CE.dtstart <= end,
_CE.dtstart < end,
_CE.status != "cancelled",
)
.order_by(_CE.dtstart)