Automatically clear subscriptions for dead Owncast instances. #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, when a subscribed Owncast instance disappears permanently, the bot continues to attempt querying its status every minute indefinitely. Since users must manually unsubscribe to stop this traffic, but receive no notifications, they are unlikely to remember the subscription exists. This causes unnecessary network traffic and lingering unused subscriptions.
A mechanic needs to be added to automatically age off streams when they fail to respond correctly for a long period of time. When an instance consistently returns errors which prevent checking the stream status, such as DNS failures or HTTPS errors, all subscriptions associated with the domain should be purged from the database. Before removal, a notification should be sent to all subscribed rooms informing them the subscription is being deleted due to prolonged connection failures.
This logic should only apply to instances which are no longer reachable, not streams that are simply offline while their instance remains online.