Skip to content

process automatic timeouts and cancellation for stalled webhook requests - #123

Merged
Abd-Standard merged 4 commits into
Core-Foundry:mainfrom
miss-yusrah:feat/automatic
Jun 21, 2026
Merged

process automatic timeouts and cancellation for stalled webhook requests#123
Abd-Standard merged 4 commits into
Core-Foundry:mainfrom
miss-yusrah:feat/automatic

Conversation

@miss-yusrah

Copy link
Copy Markdown
Contributor

Description

Introduces automatic timeout detection and cancellation for external notification requests (like Discord webhooks) to safely prevent system hanging and limit resource leakage during severe network degradation.

Changes Made

  • Configurable Thresholds: Appended a timeoutMs property parameter to the DiscordConfig profile (defaulting to 5 seconds) to govern maximum acceptable processing limits.
  • Safe Cancellations: Re-engineered the standard HTTP fetch payload inside sendWebhook to securely bind to an AbortController. Stalled operations safely trigger signal halts automatically via an asynchronous cancellation timer.
  • Metrics Tracking & Diagnostics: Configured the local logger infrastructure to specifically trap generic AbortError scenarios over timeouts. It now directly records and tallies timeoutCount metadata while dynamically emitting diagnostic metrics logging (including payload ID variables) safely for deep architectural analysis.
  • CI Test Suite Stabilization: Upgraded core Jest implicit typing rules cross-service, including adding required @jest/globals imports and updating strict typing assertions for API mocks (events-server and rate-limiter suites), ensuring the build static analysis generates clean code passes cleanly.

Acceptance Criteria Passed

  • ✅ Long-running requests time out safely.
  • ✅ Metrics capture timeout events successfully out of bounds.
  • ✅ Structured diagnostic logs successfully aid external debugging architectures.
  • ✅ The entire TypeScript build checks, Linter, and 21 Jest testing scopes complete flawlessly (Exit Code: 0).

closes #81

@Abd-Standard
Abd-Standard merged commit a6f333d into Core-Foundry:main Jun 21, 2026
2 checks passed
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 Notification Delivery Timeout Handler

2 participants