Skip to content

feat: implement configurable exponential backoff for webhook retries - #904

Open
barry01-hash wants to merge 2 commits into
StellaBridge:mainfrom
barry01-hash:feat/webhook-exponential-backoff
Open

feat: implement configurable exponential backoff for webhook retries#904
barry01-hash wants to merge 2 commits into
StellaBridge:mainfrom
barry01-hash:feat/webhook-exponential-backoff

Conversation

@barry01-hash

Copy link
Copy Markdown
Contributor

Closes #815

  • Add migration 047_webhook_retry_backoff for per-endpoint retry config columns
  • Add retryMaxAttempts, retryBaseDelayMs, retryMaxDelayMs, retryBackoffMultiplier, retryJitterRatio to webhook_endpoints
  • Add computeRetryDelay helper with exponential backoff + jitter support
  • Fix next_retry_at bug where RETRY_DELAYS[Math.min(0,0)] always used index 0
  • Update createEndpoint/updateEndpoint to accept backoff configuration
  • Update webhook delivery worker to use endpoint-specific retry policies
  • Update mapToEndpoint to include new backoff fields
  • Add WebhookRetryConfig type with safe defaults (7 retries, 1s base, 2x multiplier, 0.2 jitter, 1h max)
  • Add validation constraints: maxAttempts 1-20, baseDelay >=100ms, multiplier 1-10, jitter 0-1
  • Update outbox service to support backoff config in create/update

Description

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Refactoring (no functional changes)
  • Documentation update
  • CI/CD change
  • Dependency update

Related Issue

Closes #

Changes Made

Testing

  • Unit tests pass locally (npm run test:unit)
  • Integration tests pass locally (npm run test:integration)
  • New tests added for new behaviour
  • Manual testing completed — describe below if relevant

Manual test steps (if applicable):

Migration Changes

  • No database migrations in this PR
  • New migration file generated with npm run migrate:make
  • Migration validated with npm run migrate:validate
  • down() function tested locally
  • No data loss in the rollback path

Documentation

  • No documentation changes needed
  • README.md updated (new commands, endpoints, or setup steps)
  • Relevant docs/ file updated
  • .env.example updated (new environment variables)
  • Inline comments / JSDoc updated for changed functions
  • backend/docs/API.md updated (new or changed endpoints)

Checklist

  • Branch is up to date with main
  • PR title follows Conventional Commits format (type(scope): summary)
  • Code follows project style — linters pass (npm run lint, cargo clippy)
  • Build succeeds (npm run build, cargo build --release)
  • No console.log / println! left in production code
  • No secrets, credentials, or .env files committed
  • Self-review completed — I have read my own diff

CI Status

  • Backend lint, build, and tests pass
  • Frontend lint, build, and tests pass
  • Contract format check, Clippy, and tests pass
  • Security scan passes (no new vulnerabilities)
  • Docker build succeeds

Screenshots

Breaking Changes

Additional Notes

- Add migration 047_webhook_retry_backoff for per-endpoint retry config columns
- Add retryMaxAttempts, retryBaseDelayMs, retryMaxDelayMs, retryBackoffMultiplier, retryJitterRatio to webhook_endpoints
- Add computeRetryDelay helper with exponential backoff + jitter support
- Fix next_retry_at bug where RETRY_DELAYS[Math.min(0,0)] always used index 0
- Update createEndpoint/updateEndpoint to accept backoff configuration
- Update webhook delivery worker to use endpoint-specific retry policies
- Update mapToEndpoint to include new backoff fields
- Add WebhookRetryConfig type with safe defaults (7 retries, 1s base, 2x multiplier, 0.2 jitter, 1h max)
- Add validation constraints: maxAttempts 1-20, baseDelay >=100ms, multiplier 1-10, jitter 0-1
- Update outbox service to support backoff config in create/update
@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@barry01-hash 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

@barry01-hash

Copy link
Copy Markdown
Contributor Author

Please merge

@Mosas2000

Copy link
Copy Markdown
Contributor

Please fix the failed check

@barry01-hash

@Mosas2000

Copy link
Copy Markdown
Contributor

@barry01-hash

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.

feat: Implement Dynamic Webhook Retry Policy with Exponential Backoff and Jitter

2 participants