comment on why since_id is double-checked.
This commit is contained in:
parent
918ed75e9b
commit
9fdcf21663
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue