fix(webhook-event-forwarder): add timeout and accept any 2xx status code #870
+34
−4
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.
Please explain how to summarize this PR for the Changelog:
Fixes webhook-event-forwarder plugin to prevent indefinite hangs and accept standard HTTP success codes. Adds configurable timeout (default 5s) using AbortController and changes status validation from strict
202check toresponse.ok(any 2xx status code).Changes
This PR addresses a critical issue where listeners using the webhook-event-forwarder plugin would become unresponsive after idle periods, requiring redeployment to recover.
Root Cause Identified:
fetch()call, causing indefinite hangs when webhooks became slow or unresponsivestatus === 202check caused failures when webhooks returned other success codes like200or201Changes Made:
timeoutoption (default 5000ms) usingAbortControllerstatus === 202toresponse.ok(accepts any 2xx status code)finallyblock to ensure timeout cleanupTell code reviewer how and what to test:
Critical Review Points:
AbortControllercleanup in thefinallyblock works correctly and doesn't leak timers202toresponse.okis technically a behavior change, but fixes a bug. Verify this is acceptable.AbortErrordetection) doesn't break existing callback implementationsTesting Recommendations:
Known Gaps:
Link to Devin run: https://app.devin.ai/sessions/1ea3382fded3463cbf0d004fcef4a4e9
Requested by: [email protected] (@cnharrison)