diff --git a/bot/bot_app.py b/bot/bot_app.py index e41c452..e688db1 100644 --- a/bot/bot_app.py +++ b/bot/bot_app.py @@ -27,7 +27,11 @@ def stream_notifications(): for notification in notifications: notif_id = notification.id - # Skip old or same ID notifications + # Double-check filtering: Even though we pass since_id to the API, + # we manually filter again for reliability because: + # 1. API might ignore since_id if it's too old (server downtime) + # 2. Pagination limits might cause missed notifications + # 3. Race conditions between fetch and save operations if last_seen_id is not None and notif_id <= last_seen_id: continue