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

オープン 初心者向け
#108 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

mailing/services/campaign_sender.py::_suppression_reasons、suppression.py::suppression_skip_reason、およびmailing/services/campaigns.py::_annotate_snapshot_skipのスナップショットゲートを読みます。配信時の再チェックにキャンペーンのコンテキストを渡し、allow_unverifiedが未検証の理由だけを回避することを確認してください。ハードバウンス、苦情、配信停止、無効なメールアドレスの検証結果は引き続き抑制される必要があります。両方のケースについてテストを追加または更新し、許可された未検証の宛先がclaim時にスキップされないことを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
0
フォーク
0
平均マージ
26分
マージ済み PR(30日)
58

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataTalksClub/relay のほかの issue

DataTalksClub/relay の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。