Fix Exception Loop in bot_app.py #9

Closed
opened 2025-05-18 04:38:38 -07:00 by VD15 · 0 comments
Collaborator

bot_app.py is set up in such a way that should the bot encounter an exception anywhere in stream_notifications(), it will remail stuck, looping over the same few notifications forever, potentially spamming users.

The root cause of this is that last_seen_notif_id is only ever updated if the bot processes a batch of notifications successfully. The function should be updated so that the bot continues to process messages in the batch after an exception has occured and marks the erroneous message as read.

image

bot_app.py is set up in such a way that should the bot encounter an exception anywhere in `stream_notifications()`, it will remail stuck, looping over the same few notifications forever, potentially spamming users. The root cause of this is that `last_seen_notif_id` is only ever updated if the bot processes a batch of notifications successfully. The function should be updated so that the bot continues to process messages in the batch after an exception has occured and marks the erroneous message as read. ![image](/attachments/eda7fe4e-5fe8-4b68-bd02-a1d26be35ab5)
178 KiB
VD15 added the
Bug
label 2025-05-18 04:38:38 -07:00
VD15 self-assigned this 2025-05-18 04:38:46 -07:00
VD15 added reference 9_fix_bot_app_py 2025-05-19 11:38:06 -07:00
VD15 closed this issue 2025-05-23 15:44:47 -07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: waifu/kemoverse#9
No description provided.