Repository navigation
fix(webhooks): stop reporting failed deliveries as platform errors - #14558
Conversation
A receiver that is down or does not resolve made the worker throw a plain Exception, which the error exporter publishes. Throw an unpublished webhook_delivery_failed instead: the broker still redelivers the event and the failure is still logged, but it no longer alerts.
|
Review complete. No issues found. The change replaces the generic thrown exception in the webhooks worker partial-failure path with a dedicated WEBHOOK_DELIVERY_FAILED error code (502) marked publish=false, adds the constant to Appwrite\Extend\Exception, and covers the retry-without-publish behavior with a new unit test.
Two low-severity observations fell below the review confidence threshold: the new unit test drives the worker action directly with real network I/O, which project guidance reserves for e2e suites, and the thrown error message aggregates up to 10KB of receiver-controlled body per failing webhook without applying APP_LOG_LENGTH_LIMIT. Reviewed commit: 300787e |
🔵 Tier A · Mergeable after minor fixes
Adds a dedicated unpublished 502 error for failed webhook deliveries while preserving the worker's existing redelivery path. Adds a regression test that exercises a failed delivery and checks the persisted attempt count and logs.
Fix with agent prompt### Issue 1
tests/unit/Platform/Workers/WebhooksTest.php:226
**Keep worker action coverage out of the unit suite**
This directly exercises `Webhooks::action()` in a unit test, but the Tests guidance in `AGENTS.md` says workers are covered by e2e and should not be unit-tested. Please move this worker-surface coverage to the appropriate integration/e2e suite; the unit suite should cover the libraries the worker calls.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 4
Reviewed |
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
A webhook receiver that fails (DNS, timeout, 5xx) made the worker throw a plain
Exception. Error reporting publishes code-0 exceptions, so every broken customer endpoint showed up as a platform error.webhook_delivery_failedis502,'publish' => false. Retries are unchanged: onlyPermanentFailure/TypeError/ValueErrorskip redelivery.Tests: the retry half is covered by the existing e2e
WebhooksBase::testRedeliveryRetriesOnlyTheWebhookThatFailed, which fails a delivery and asserts it is redelivered. There is no e2e for the "not published" half: the compose stack runs no error-reporting sink to assert against.Related: appwrite-labs/cloud#5938