[notifications] Implement feed.seal_lost notification type

Open
#1,930 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api, backend

Research direction

Start by reading the notification event, subscription, and delivery code to find how events are created and dispatched. Implement the seal status transition as the source of truth, creating one feed.seal_lost event only when a feed loses Seal status, with the provider, optional name, loss date, and triggering criterion. Done means dispatch can match the event to active subscriptions and track delivery per event, subscription, and channel without duplicate notifications.

Written by the indexing model from the issue text.

Description

Describe the problem

Implement the feed.seal_lost notification type for cases where a feed loses the Seal of Reliability in the Mobility Database. Members want to be notified when a feed they care about no longer meets the quality threshold.

Proposed solution

When a feed loses the Seal of Reliability, use the seal status change as the source of truth for the feed.seal_lost notification.

A notification should be created only when a feed transitions out of Seal status, not when the feed is simply re-evaluated with no change in status. The event should include feed provider, name if it exists, the day the Seal was lost, and which criterion prompted the change.

To support this:

Notification event table

When a feed loses the Seal, create a notification_event record with notification_type = feed.seal_lost. The dispatcher can then query new events, match them to active subscriptions, generate the digest based on cadence, and track delivery per user.

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 seal status change. The dispatcher should match the event to active notification_subscription records and create/update one notification_log per notification_event_id + subscription_id + channel.

This allows the system to know which users already received the event, avoid duplicate notifications, and retry failed deliveries without resending to users who were already notified.

Alternatives you've considered

Polling-based detection: query feeds where seal status changed since the last successful notification run. This is simpler, but it risks missed or duplicated notifications if the dispatcher fails or if delivery needs to be retried per user.

Additional context

Suggested notification codes:

  • feed.seal_lost
  • feed.seal_revoked
  • feed.quality_threshold_missed
Dominant language
Python
Stars
34
Forks
7
Avg merge
3d 3h
Merged PRs (30d)
22

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MobilityData/mobility-feed-api

All issues in MobilityData/mobility-feed-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.