fix(webhook-event-forwarder): add timeout and accept any 2xx status code#870
fix(webhook-event-forwarder): add timeout and accept any 2xx status code#870devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Add configurable timeout option (default 5 seconds) using AbortController - Change from strict status === 202 check to response.ok (accepts any 2xx) - Improve error messages to distinguish timeout vs other errors - Add timeout configuration example to README This fixes an issue where listeners would hang indefinitely if the webhook endpoint became slow or unresponsive, especially after idle periods. The strict 202 check also caused failures when webhooks returned 200 or 201. Co-Authored-By: christopher.harrison@flatfile.io <cnharrison@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…sages Update test expectations to match the improved error message format that now includes HTTP status code and status text for better debugging. Co-Authored-By: christopher.harrison@flatfile.io <cnharrison@gmail.com>
|
📝 Documentation updates detected! New suggestion: Add changelog entry for webhook-event-forwarder timeout and status code fixes |
CI Failure InvestigationThe E2E test failure in Evidence:
Root cause: This appears to be a flaky test or CI environment issue (network/timeout). The "fetch failed" error suggests a transient network problem in the CI environment. Recommendation: Re-run the E2E job or wait for the next CI run. The webhook-event-forwarder changes are working correctly. |
|
Closing due to inactivity for more than 7 days. Configure here. |
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: christopher.harrison@flatfile.io (@cnharrison)