Campaign dispatch recheck ignores allow_unverified: recipients skipped as 'unverified' at claim time
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Read mailing/services/campaign_sender.py::_suppression_reasons, suppression.py::suppression_skip_reason, and the snapshot gate in mailing/services/campaigns.py::_annotate_snapshot_skip. Pass the campaign context into the dispatch recheck and confirm allow_unverified only bypasses the unverified reason; hard bounces, complaints, unsubscribes, and invalid email validation must remain suppressed. Add or update tests for both cases and verify an allowed unverified recipient is not skipped at claim time.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 26m
- Merged PRs (30d)
- 58
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataTalksClub/relay
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
DataTalksClub/relay#48 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
DataTalksClub/relay#49 · 3 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 5/5 Over a week Newbie friendliness 20/100
DataTalksClub/relay#42 · 7 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
DataTalksClub/relay#41 · 9 comments ·
Maintainers usually reply within 1 day
-
community-base enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataTalksClub/relay#39 · 6 comments ·
Maintainers usually reply within 1 day
All issues in DataTalksClub/relay
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
btclib-org/btclib#3062 ·
Maintainers usually reply within 1 day
-
area:evals area:infra enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jse-avl/support-bot#4 · 1 comment ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
qte77/agentic-job-offer-to-application-kit#487 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#801 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 94/100