Campaign dispatch recheck ignores allow_unverified: recipients skipped as 'unverified' at claim time

Đang mở Phù hợp với người mới
#108 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 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api, backend

Hướng nghiên cứu

Đọc mailing/services/campaign_sender.py::_suppression_reasons, suppression.py::suppression_skip_reason và cổng kiểm tra snapshot trong mailing/services/campaigns.py::_annotate_snapshot_skip. Truyền ngữ cảnh chiến dịch vào lần kiểm tra lại khi gửi và xác nhận rằng allow_unverified chỉ bỏ qua lý do chưa xác minh; hard bounce, khiếu nại, hủy đăng ký và xác thực email không hợp lệ vẫn phải bị chặn. Thêm hoặc cập nhật kiểm thử cho cả hai trường hợp và xác minh rằng người nhận chưa được xác minh nhưng được phép không bị bỏ qua tại thời điểm nhận xử lý.

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

Mô tả

Evidence (production, 2026-11-11 01:32 UTC)

An API campaign queued with allow_unverified: true (recipient_list_key aishl-test-21-…, 200 recipients) finished dispatch in ~4s with status=sent and all 200 campaign_recipients status=skipped, skip_reason='unverified', zero SES message ids, zero counters. The snapshot annotation honored the flag (recipients created as pending candidates), but the worker's suppression recheck skipped every one at claim time.

Root cause

mailing/services/campaign_sender.py::_suppression_reasons calls suppression.py::suppression_skip_reason(contact, …), which returns UNVERIFIED whenever neither the contact nor its audience/client subscription has verified_at — it never sees campaign.allow_unverified. The snapshot-time annotation (mailing/services/campaigns.py::_annotate_snapshot_skip, line ~236) correctly gates the UNVERIFIED rule on if not campaign.allow_unverified, so the flag is only half-implemented: allowed at snapshot, ignored at dispatch.

Suggested fix

_suppression_reasons has the campaign in scope; pass it through and skip the UNVERIFIED branch when campaign.allow_unverified is set (mirroring the snapshot gate). Suppression for hard bounces, complaints, unsubscribes and invalid email validation should stay unconditional.

Impact

Any API client using allow_unverified campaigns (the documented partner for recipient_list_key sends — the flag is even required to be paired with a recipient list) silently sends to nobody. The AISHL website's guarded internal bulk proof depends on it; a website-side workaround (verifying contacts at upsert) shipped in AI-Shipping-Labs/website#2085 as a stopgap.

Ngôn ngữ chính
Python
Star
0
Fork
0
Merge trung bình
26 phút
Pull request đã merge (30 ngày)
58

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Không 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 DataTalksClub/relay

Tất cả issue của DataTalksClub/relay

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.