Describe the problem
Implement the feed.url_availability notification type for cases where a feed URL becomes unavailable or comes back online. This should detect availability state changes, build the notification payload for subscribed users, and integrate with the notification dispatcher.
Proposed solution
When a feed URL becomes unavailable for 7 days
Use feed availability monitoring as the source of truth for the feed.url_availability notification.
A notification should be created only when the feed URL changes from available to unavailable, not every time a feed check fails. The event should include the feed ID, feed URL, HTTP status code or error reason, first failure time, latest checked time, and availability status.
To support this:
Notification event table
When the system detects that a feed has become unavailable, create a notification_event record with notification_type = feed.url_availability and event_type = became_unavailable.
When a feed URL comes back online
Use the same feed availability monitoring data as the source of truth when a feed URL changes from unavailable to available.
The notification should explain that the feed URL is available again and include the outage period when possible.
To support this:
Notification event table
When the system detects that a previously unavailable feed is available again, create a notification_event record with notification_type = feed.url_availability and event_type = became_available. The event should include the feed ID, feed URL, recovery time, previous failure reason, and outage duration if available.
Tracking notifications per user
Use notification_event to track what happened, and notification_log to track delivery per user subscription.
Each notification_event should be created once for the availability event. The dispatcher should match the event to active notification_subscription records and create/update one notification_log per notification_event_id + subscription_id + channel.
Alternatives you've considered
Timestamp-based detection
Use last_notified_at on notification_subscription and query feed availability records updated after that timestamp. This is simpler, but it risks missed or duplicated notifications if the dispatcher fails or if multiple availability changes happen between runs.
Additional context
Suggested notification code:
feed.url_availability
Suggested event_type values:
became_unavailable
became_available
Describe the problem
Implement the
feed.url_availabilitynotification type for cases where a feed URL becomes unavailable or comes back online. This should detect availability state changes, build the notification payload for subscribed users, and integrate with the notification dispatcher.Proposed solution
When a feed URL becomes unavailable for 7 days
Use feed availability monitoring as the source of truth for the
feed.url_availabilitynotification.A notification should be created only when the feed URL changes from available to unavailable, not every time a feed check fails. The event should include the feed ID, feed URL, HTTP status code or error reason, first failure time, latest checked time, and availability status.
To support this:
Notification event table
When the system detects that a feed has become unavailable, create a
notification_eventrecord withnotification_type = feed.url_availabilityandevent_type = became_unavailable.When a feed URL comes back online
Use the same feed availability monitoring data as the source of truth when a feed URL changes from unavailable to available.
The notification should explain that the feed URL is available again and include the outage period when possible.
To support this:
Notification event table
When the system detects that a previously unavailable feed is available again, create a
notification_eventrecord withnotification_type = feed.url_availabilityandevent_type = became_available. The event should include the feed ID, feed URL, recovery time, previous failure reason, and outage duration if available.Tracking notifications per user
Use
notification_eventto track what happened, andnotification_logto track delivery per user subscription.Each
notification_eventshould be created once for the availability event. The dispatcher should match the event to activenotification_subscriptionrecords and create/update onenotification_logpernotification_event_id+subscription_id+channel.Alternatives you've considered
Timestamp-based detection
Use
last_notified_atonnotification_subscriptionand query feed availability records updated after that timestamp. This is simpler, but it risks missed or duplicated notifications if the dispatcher fails or if multiple availability changes happen between runs.Additional context
Suggested notification code:
feed.url_availabilitySuggested
event_typevalues:became_unavailablebecame_available