Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(workflows): log the silent paths in SES tenant sync (#88478)

Daniel Marchukcb57d2b5b0fb
diff --git a/products/workflows/backend/api/ses_events_webhook.py b/products/workflows/backend/api/ses_events_webhook.py
index 92ba3b0a6ccf..7c7e5ddc84e3 100644
--- a/products/workflows/backend/api/ses_events_webhook.py
+++ b/products/workflows/backend/api/ses_events_webhook.py
@@ -104,6 +104,9 @@ def ses_tenant_events_webhook(request: HttpRequest) -> HttpResponse:
logger.warning("ses_tenant_events_webhook_no_tenant", detail_type=event.get("detail-type"))
return HttpResponse(status=200)
+ # Logged because the only other line on this path is the failure one, which leaves a handled
+ # delivery and an ignored one looking identical from outside: both answer 2xx.
+ logger.info("ses_tenant_events_webhook_accepted", team_id=team_id, detail_type=event.get("detail-type"))
# Ack fast; the sync fetches authoritative state and sends any transition emails.
sync_ses_tenant_state_task.delay(team_id)
return HttpResponse(status=202)
diff --git a/products/workflows/backend/services/ses_tenant_state.py b/products/workflows/backend/services/ses_tenant_state.py
index 485011e9a6ca..6360be32c024 100644
--- a/products/workflows/backend/services/ses_tenant_state.py
+++ b/products/workflows/backend/services/ses_tenant_state.py
@@ -95,6 +95,8 @@ def apply_ses_tenant_state(
if previous_status == sending_status and previous_impact == impact:
config.ses_tenant_state_synced_at = timezone.now()
config.save(update_fields=["ses_tenant_state_synced_at"])
+ # Without this, a sync that found nothing and a sync that never ran look the same.
+ logger.info("SES tenant state unchanged", team_id=team_id, status=sending_status, impact=impact)
return
now = timezone.now()