Skip to content

feat: webhook circuit breaker - #604

Merged
martinzhames merged 2 commits into
dupdab:mainfrom
MJigah:feat/457-webhook-circuit-breaker
Oct 23, 2026
Merged

martinzhames merged 2 commits into
dupdab:mainfrom
MJigah:feat/457-webhook-circuit-breaker

Conversation

@MJigah

@MJigah MJigah commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Adds circuitOpenUntil to Webhook (with migration). After 5 consecutive failures the circuit opens for 24h; the processor skips deliveries and schedules no further retries while it is open. A successful delivery clears it.
  • Admin alert (WEBHOOK_FAILURE, deduped per webhook) and a webhook-circuit-open email to the merchant when the circuit opens.
  • POST /admin/webhooks/:id/circuit/reset (superadmin) closes the circuit and clears the failure count.

Notes

  • WebhookDeliveryProcessor now injects AdminAlertService and EmailService; existing specs that construct it directly were not updated.
  • No tests, builds or lint were run.

Closes #457

After 5 consecutive delivery failures the circuit opens for the webhook
endpoint for 24h: deliveries are skipped and no retries are scheduled.
Opening the circuit raises an admin alert and emails the merchant. Admins can
reset an open circuit with POST /admin/webhooks/:id/circuit/reset.

Closes dupdab#457
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@MJigah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…rcuit-breaker

# Conflicts:
#	src/webhooks/webhooks.module.ts
@martinzhames
martinzhames merged commit 0dc9170 into dupdab:main Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] Implement webhook circuit breaker to prevent spamming failing endpoints

2 participants