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

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.