Skip to content

feat: configurable webhook delivery timeout + fix merge artifacts - #898

Merged
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Vvictor-commits:feature/configurable-webhook-timeout
Oct 2, 2026
Merged

Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Vvictor-commits:feature/configurable-webhook-timeout

Conversation

@Vvictor-commits

@Vvictor-commits Vvictor-commits commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #837


Summary

Adds administrator-configurable timeout for outbound webhook delivery requests, and fixes several merge artifacts that were causing TypeScript syntax and compilation errors.

Feature: WEBHOOK_DELIVERY_TIMEOUT_MS

Admins can now control how long the retry scheduler waits for a webhook endpoint to respond before treating the request as a failure.

# listener/.env.example
WEBHOOK_DELIVERY_TIMEOUT_MS=10000   # default: 10 000 ms

Files changed:

  • listener/src/types/index.ts — added webhookTimeoutMs: number to RetrySchedulerOptions
  • listener/src/services/retry-scheduler.ts — added field to RetrySchedulerConfig / RETRY_SCHEDULER_DEFAULTS; constructor passes it to WebhookDeliveryService
  • listener/src/config.ts — reads WEBHOOK_DELIVERY_TIMEOUT_MS in loadRetrySchedulerConfig()
  • listener/.env.example — documents the new variable

Timed-out requests surface as AbortError inside WebhookDeliveryService, which already returns success: false and triggers normal retry backoff — no changes needed there.

Bug fixes (pre-existing merge artifacts)

File Issue
utils/request-id.ts Missing closing } on generateCorrelationId() — body ran into next JSDoc block
middleware/security-headers.ts Invalid import type { http.ServerResponse } syntax; function signature used http.ServerResponse
services/discord-notification.ts Missing } on sanitizeForDiscord(); dead unreachable return in scvString case
index.ts Duplicate healthMonitor construction with orphaned lines; duplicate subscriber declaration; broken shutdown try block
api/events-server.ts Duplicate TemplateService/handleTemplateRoutes imports; missing handleApiError + applyRequestIdMiddleware imports
config.ts Duplicate types import line; missing validateSecrets import
services/event-subscriber.ts Duplicate processableEvents declaration; duplicate getContractEvents request block; missing backfillStartLedger class property

Testing

  • WEBHOOK_DELIVERY_TIMEOUT_MS flows from env → RetrySchedulerOptions → WebhookDeliveryService({ timeoutMs })
  • Timeout failures are caught as AbortError by the existing handler and returned as success: false, consumed by RetryScheduler.processRetry() as a retryable failure
  • Existing WebhookDeliveryService and retry-scheduler-webhook.test.ts tests remain valid (they pass an explicit mock, bypassing the constructor default)

…EOUT_MS)

- Add webhookTimeoutMs field to RetrySchedulerOptions and RetrySchedulerConfig
- Read WEBHOOK_DELIVERY_TIMEOUT_MS env var in loadRetrySchedulerConfig() (default 10 000 ms)
- Pass timeout to WebhookDeliveryService constructor in RetryScheduler
- Document new env var in .env.example

Fix pre-existing merge artifacts:
- request-id.ts: restore missing closing brace on generateCorrelationId()
- security-headers.ts: fix invalid 'http.ServerResponse' import type syntax
- discord-notification.ts: remove dead unreachable return in scvString case; restore missing closing brace on sanitizeForDiscord()
- index.ts: collapse duplicate healthMonitor construction, remove duplicate subscriber declaration, fix broken shutdown try/catch block
- events-server.ts: remove duplicate TemplateService/handleTemplateRoutes imports; add missing handleApiError and applyRequestIdMiddleware imports
- config.ts: remove duplicate types import line; add missing validateSecrets import
- event-subscriber.ts: remove duplicate processableEvents declaration; collapse duplicate getContractEvents request block; add missing backfillStartLedger property
@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@Vvictor-commits 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

@Abd-Standard
Abd-Standard merged commit 4199e79 into Core-Foundry:main Oct 2, 2026
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.

Add Notification Delivery Timeout Configuration

2 participants