comment on why since_id is double-checked.

This commit is contained in:
Moon 2025-06-12 14:17:22 +09:00
parent 918ed75e9b
commit 9fdcf21663

View file

@ -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