What's fixed
- Auth proxy hard timeout:
supabase.auth.getUser()in the edge proxy is now bounded by a configurable timeout (default 2000ms, env-tunable). A stalled GoTrue or Supavisor pool can no longer cascade intoMIDDLEWARE_INVOCATION_TIMEOUT504s for every authenticated request; instead the request degrades to an unauthenticated state with anx-auth-degradedobservability header. - Webhook fail-fast: the Meta/WhatsApp webhook routes now return HTTP 503 with
retry-after: 30on transient DB errors (pool checkout timeouts, connection drops, fetch failures). Meta Cloud API retries any non-2xx with exponential backoff for ~7 days, so Meta's existing redelivery queue is now our durable buffer in front of Postgres — no more silent inbound-message drops during DB pool incidents. - Structured incident logging: failed webhook ingestion logs a sanitized
webhook.ingest.failedevent (trace id, body sha256 hash, last completed pipeline stage, error name/message — no PII) plus a separatewebhook.ingest.unexpectedline for non-transient errors so Sentry alerts can distinguish logic regressions from infra incidents.
Why
Companion patch to v0.16.23. Where v0.16.23 narrowed the proxy matcher so unprotected API routes don't run Supabase auth at all, v0.16.24 adds a hard time bound around the auth call when it does run, and stops the inbound webhook pipeline from hanging when Postgres is sick.