Skip to content

fix: classify a webhook reset on the error cause and retry a resolver failure (#896) - #907

Merged
HugoXK merged 3 commits into
mainfrom
fix/896-webhook-classification
Nov 16, 2026
Merged

HugoXK merged 3 commits into
mainfrom
fix/896-webhook-classification

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Written-by: HugoXK

Fixes #896

What changed:

  • isAmbiguousWebhookFailure() reads error.cause.code as well as error.code, so Undici's ECONNRESET / EPIPE / UND_ERR_SOCKET on the cause is unknown and is not replayed automatically.
  • assertSafeWebhookUrl now throws WebhookAddressError with a kind: policy refusals (scheme, credentials, allowlist, private or reserved address) are blocked; a resolver failure (the resolver throws or returns no address) is retry.
  • postWebhook uses that kind; the old catch-all blocked is gone.
  • Tests: a caused ECONNRESET is unknown and is not claimed on the next pass; a resolver EAI_AGAIN is retry; a private resolved address stays blocked.
  • docs/security.md states the distinction.

Ran:

  • npx tsx --test test/notificationOutbox.test.ts test/webhookSsrf.test.ts — 21/21 pass
  • npm run lint — pass (11 baselined warnings)
  • npm run typecheck — pass
  • npm run build — pass
  • npm test — 2304/2306 pass; the two failures are pre-existing environment failures (test/gateBaseTree.test.ts, test/nginxCheck.test.ts) that also fail on a clean origin/main
  • node scripts/risk-gate.mjs --base origin/main — risk-tier: T2
  • node scripts/version.mjs check — ok
  • npm run secret:scan — clean
  • node scripts/changelog.mjs check — 9 fragments ok

Not run:

  • A live webhook endpoint or real DNS; the transports are driven by injected fetch/resolver.
  • GitHub Actions (the PR runs CI).

Risk: T2 (src/lib/webhook.ts); a PASS at the tip is required.

Comment thread src/lib/webhook.ts Fixed

@HugoXK-bot HugoXK-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS at 8d51598
Written-by: HugoXK-bot

Ran:

  • npx tsx --test test/notificationOutbox.test.ts test/webhookSsrf.test.ts — 21/21 pass
  • npm run lint — pass (11 baselined warnings)
  • npm run typecheck — pass
  • npm run build — pass
  • npm test — 2304/2306 pass; the two failures are pre-existing environment failures (test/gateBaseTree.test.ts, test/nginxCheck.test.ts) that also fail on a clean origin/main
  • node scripts/risk-gate.mjs --base origin/main — risk-tier: T2

Not run:

  • A live webhook endpoint or real DNS; the transports are driven by injected fetch/resolver.
  • GitHub Actions (the PR runs CI).

Comment thread src/lib/webhook.ts Fixed

@HugoXK-bot HugoXK-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS at ef59785
Written-by: HugoXK-bot

Ran:

  • npx tsx --test test/notificationOutbox.test.ts test/webhookSsrf.test.ts — 21/21 pass
  • npm run lint — pass (11 baselined warnings)
  • npm run typecheck — pass
  • npm run build — pass
  • npm test — 2304/2306 pass; the two failures are pre-existing environment failures (test/gateBaseTree.test.ts, test/nginxCheck.test.ts) that also fail on a clean origin/main
  • node scripts/risk-gate.mjs --base origin/main — risk-tier: T2

Not run:

  • A live webhook endpoint or real DNS; the transports are driven by injected fetch/resolver.
  • GitHub Actions (the PR runs CI).

@HugoXK-bot HugoXK-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS at 8974d00
Written-by: HugoXK-bot

Ran:

  • npx tsx --test test/notificationOutbox.test.ts test/webhookSsrf.test.ts — 21/21 pass
  • npm run lint — pass (11 baselined warnings)
  • npm run typecheck — pass
  • npm run build — pass
  • npm test — 2304/2306 pass; the two failures are pre-existing environment failures (test/gateBaseTree.test.ts, test/nginxCheck.test.ts) that also fail on a clean origin/main
  • node scripts/risk-gate.mjs --base origin/main — risk-tier: T2

Not run:

  • A live webhook endpoint or real DNS; the transports are driven by injected fetch/resolver.
  • GitHub Actions (the PR runs CI).

@HugoXK
HugoXK merged commit f4c6227 into main Nov 16, 2026
39 of 41 checks passed
@HugoXK
HugoXK deleted the fix/896-webhook-classification branch November 16, 2026 07:13
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.

bug: a possible delivery is resent because webhook classification reads error.code, and a transient DNS failure blocks permanently

3 participants