Repository navigation
refactor(webhooks): split webhook-delivery.service.ts by concern (#387) - #392
Merged
Merged
Conversation
webhook-delivery.service.ts (849 lines) is now a 56-line entry module re-exporting the same 10 symbols, with the code moved whole into schedule, claim, attempt, query, outcome and retention files. Every SSRF and response-size check is byte-for-byte the same code. No behaviour change: the same runtime exports and strictly identical types as main, 0 differing lines, identical results in a 16-case local delivery smoke run, and every test passes untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #387:
src/modules/webhooks/services/webhook-delivery.service.ts(849 lines) is split by concern with no behaviour change. It stays the entry module (56 lines) re-exporting the same 10 symbols, so no importer or test changes.Changes
webhook-delivery.service.tswebhook-delivery-schedule.service.tsnextAttemptAtwebhook-delivery-claim.service.tsreadWebhookSecretwebhook-delivery-attempt.service.tswebhook-delivery-query.service.tswebhook-delivery-outcome.service.tsrecordAttemptwebhook-delivery-retention.service.tsexporton two symbols the outcome file needs (not re-exported), one new JSDoc on the entry, and two stale comments (inwebhook-dispatch.service.tsanddocs/webhooks.md) that wrongly saidsignPayloadwas re-exported here.resolvePublicWebhookTarget, DNS pinning withHostand SNI,keepalive: false,decompress: false,redirect: "manual", the per-attempt timeout, refusal without a secret) and the 8 KB response read cap.src/index.tsunchanged.docs/webhooks.md,ARCHITECTURE.md, a comment insrc/config/retention.ts,CHANGELOG.md.Proof it is a pure move
Environment
oven/bun:1.3.14)Test Plan
lint:mocks, prettiermx-transport.test.tsSTARTTLS failures (need real Node in the container; pass on CI)Docs
CHANGELOG.mdupdated under[Unreleased]Related Issues
Part of #387.