Fix Exception Loop in bot_app.py #9

Open
opened 2 days ago by VD15 · 0 comments
VD15 commented 2 days ago
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 2 days ago
VD15 self-assigned this 2 days ago
VD15 added reference 9_fix_bot_app_py 21 hours ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: waifu/kemoverse#9
Loading…
There is no content yet.