fix: treat a non-numeric calendar alert_minutes as unset (#28790)

A calendar event's `meta` is a free-form dict, so `meta.alert_minutes` can hold any JSON type, while the upcoming-events lookup assumed it was a number and compared it directly. It now ignores a value that is not numeric and falls back to the default alert window for that event.

Handled on the read side rather than on the write path so events already stored with a non-numeric value are covered too. Numeric values are untouched, including the negative "no alert" sentinel.
This commit is contained in:
Classic298
2026-08-19 11:16:00 -07:00
committed by GitHub
parent 2e7df54673
commit abc69000b3
+4 -4
View File
@@ -734,10 +734,10 @@ class CalendarEventTable:
events = []
for event, tz in rows:
model = CalendarEventModel.model_validate(event)
# Determine per-event alert window
alert_minutes = None
if model.meta and 'alert_minutes' in model.meta:
alert_minutes = model.meta['alert_minutes']
# meta is user-writable and this poll is shared by every user.
alert_minutes = (model.meta or {}).get('alert_minutes')
if not isinstance(alert_minutes, (int, float)):
alert_minutes = None
if alert_minutes is not None:
if alert_minutes < 0: