Skip to content

Feat/webhook replay nelly439 - #933

Merged
Tybravo merged 5 commits into
Tybravo:mainfrom
nelly439:feat/webhook-replay-nelly439
Oct 23, 2026
Merged

Tybravo merged 5 commits into
Tybravo:mainfrom
nelly439:feat/webhook-replay-nelly439

Conversation

@nelly439

Copy link
Copy Markdown
Contributor

Endpoint: POST /api/v1/developer/webhooks/:id/deliveries/:deliveryId/replay

  • Reuses the stored payload and HMAC signature.
  • Strictly replays only failed deliveries.
  • Preserves Controller → Service → Model layering and atomic replay claim.
  • Commit pushed: a4bca26 fix: restrict webhook replay to failed deliveries
  • Verified: 22 targeted tests passed and tsc --noEmit passed.
    closes [Backend] [Feature] Implement webhook replay endpoint #762

nelly439 and others added 5 commits October 21, 2026 14:09
…ed payload and signature

Adds POST /api/v1/developer/webhooks/:id/deliveries/:deliveryId/replay so
stuck integrations can re-dispatch failed deliveries.

Work done:
- WebhookDelivery model persists the exact payload bytes and HMAC signature
  of every dispatch (pending/delivered/failed/replaying lifecycle)
- WebhookDeliveryService with createAndDispatch producer API and
  replayFailedDelivery: fetch -> authorize -> atomic failed->replaying claim
  -> re-dispatch stored bytes verbatim -> persist final state
- Strict Controller -> Service -> Model layering on the versioned
  /api/v1/developer router: x-api-key auth, owner/admin authorization, zod
  path-parameter validation, AppError-based error responses
- Only failed deliveries are replayable (409 otherwise); concurrent replays
  are serialized by an atomic compare-and-swap; stale claims left by a
  crashed process are reclaimable
- Global error handler now maps HttpError to its statusCode so missing/invalid
  API keys return 401 instead of 500
- Restores jest.setup.afterEnv.ts referenced by jest.config.ts (backend test
  suites could not run at all without it)
- 22 new unit tests (replay state machine + route schema), all passing

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@Tybravo

Tybravo commented Oct 23, 2026

Copy link
Copy Markdown
Owner

@nelly439

Thank you for your contribution

@Tybravo
Tybravo merged commit eb1f6f4 into Tybravo:main Oct 23, 2026
1 check failed
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] [Feature] Implement webhook replay endpoint

2 participants