Repository navigation
feat(messaging): set hard_bounced_at from the suppression writers - #125374
Conversation
The Customer.io importer marks bounced and invalid addresses as hard-bounced, so the send path stops relying on their reason text. Removing a suppression clears the mark, so a re-enabled address starts clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
🤖 CI report
|
| First copy | Second copy | Lines | Tokens |
|---|---|---|---|
products/warehouse_sources/backend/temporal/data_imports/sources/incident_io/incident_io.py:17 |
products/warehouse_sources/backend/temporal/data_imports/sources/sendgrid/sendgrid.py:21 |
12 | 116 |
products/messaging/backend/models/message_suppression.py:35 |
products/messaging/backend/models/supabase_auth_email_config.py:12 |
11 | 75 |
⚠️ Duplication (TypeScript) — 1 new duplicated block (worst 71 tokens)
New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.
| First copy | Second copy | Lines | Tokens |
|---|---|---|---|
products/web_analytics/frontend/pageReports/pageReportDetailLogic.ts:242 |
products/web_analytics/frontend/pageReports/pageReportDetailLogic.ts:256 |
12 | 71 |
✅ Django migration risk — migration analysis complete
We've analyzed your migrations for potential risks.
Summary: 1 Safe | 0 Needs Review | 0 Blocked
✅ Safe
Brief or no lock, backwards compatible
messaging.0011_messagesuppression_hard_bounced_at
└─ #1 ✅ AddField
Adding nullable field requires brief lock
model: messagesuppression, field: hard_bounced_at
📚 How to Deploy These Changes Safely
AddField:
This operation acquires a brief lock but doesn't rewrite the table.
Deployment uses lock timeouts with automatic retries, so lock contention will cause retries rather than connection pile-up.
Last updated: 2026-10-29 12:28 UTC (cfc9abd)
eddcfa7 to
fe6aee0
Compare
The node writes treat a BOUNCE row with a legacy hard-bounce reason as hard-bounced. A removed row kept that reason, so the next soft bounce or complaint set hard_bounced_at again, and the re-enabled address later lost transactional email. Removing a suppression now clears the reason as well. Generated-By: PostHog Desktop Task-Id: 120fc7fd-3cc1-484a-99ee-da0e2036ca93
|
Risk: No findings This change marks Customer.io-imported bounce/invalid-email suppressions with Sentinel reviewed |
|
/depot retry |
|
This pull request was merged into |
Problem
hard_bounced_at, and falls back to the row's reason text for rows written before that column existed.BOUNCErows for the bounces and invalid-emails lists and leaves the column null, so every new import adds another row the fallback has to carry.hard_bounced_atset, so a re-enabled address would still be treated as dead.Changes
hard_bounced_aton rows it creates from the bounces and invalid-emails lists. Customer.io lists an address there only when it can't receive mail.hard_bounced_atand the reason, so a re-enabled address starts clean. A legacy hard-bounce reason left on the row would set the mark again on the next soft bounce or complaint.How did you test this code?
products/messaging/backend/locally: 453 passed.Test rationale:
test_provider_imports.pyasserts that a Customer.io bounce import setshard_bounced_atand a spam report does not. It catches an importer that marks a working address as dead, which would drop its invoices and password resets.hard_bounced_atand a legacy hard-bounce reason. A removal that keeps the mark would block transactional email to an address a user deliberately re-enabled.Release status
Docs update
None.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5
Created with PostHog from a Slack thread
🤖 Generated with Claude Code