Skip to content

feat(backend): add webhook retry scheduler#1799

Open
brentthomas248 wants to merge 1 commit into
QuickLendX:mainfrom
brentthomas248:codex/quicklendx-1710-webhook
Open

feat(backend): add webhook retry scheduler#1799
brentthomas248 wants to merge 1 commit into
QuickLendX:mainfrom
brentthomas248:codex/quicklendx-1710-webhook

Conversation

@brentthomas248

Copy link
Copy Markdown

Closes #1710

Summary:

  • Repair webhook queue singleton reset so the backend test suite can reset queue state safely.
  • Make retry backoff deterministic and testable, including first-failure scheduling from the first delay bucket.
  • Add claimDue(now) so workers claim pending deliveries and failed deliveries only when their retry is due.
  • Expose deadLetterCount in webhook queue stats.
  • Extend v009 webhook_queue schema with attempts, max_attempts, next_attempt_at, dead_letter status, and a status/next_attempt scheduler index.
  • Add focused Jest coverage for retry timing, due claiming, DLQ stats, and migration schema.

Tests:

  • npm --prefix backend test -- webhook-delivery-repo.test.ts webhookQueue.persist.test.ts webhook-queue-migration.test.ts --runInBand --coverage=false
  • git diff --check

Notes:

  • npx tsc --noEmit is currently blocked by a pre-existing syntax error in backend/src/index.ts around lines 78-79, outside this patch.

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.

Backend: add a webhook queue exponential-backoff scheduler with jitter and max-attempt DLQ promotion

1 participant