[notifications] Implement feed.seal_earned notification type

Đang mở
#1,929 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python

Hướng nghiên cứu

Start by locating the seal status change handling and the notification event, subscription, and log models; the issue does not name specific files or tests. Trace how a feed transitions to earning the Seal and how the dispatcher processes events. Done means one feed.seal_earned event is created per status transition, with the stated feed and criterion details, and delivery tracking avoids duplicate notifications while allowing retries.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the problem

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

Proposed solution
When a feed earns the Seal of Reliability, use the seal status change as the source of truth for the feed.seal_earned notification.

A notification should be created only when a feed transitions to earning the Seal, 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 earned, and which criterion prompted the change.

To support this:

Notification event table
When a feed earns the Seal, create a notification_event record with notification_type = feed.seal_earned. 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_earned
  • feed.seal_awarded
  • feed.quality_threshold_met
Ngôn ngữ chính
Python
Star
34
Fork
7
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MobilityData/mobility-feed-api

Tất cả issue của MobilityData/mobility-feed-api

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.