Repository navigation
fix: add socket timeouts to postSlackReply and downloadSlackFile - #573
Merged
chaitanyagiri merged 1 commit intoOct 2, 2026
Merged
Conversation
postSlackReply (src/main/slack.ts) and downloadSlackFile (src/main/index.ts) issued raw node:https requests with no timeout anywhere. A peer that accepts the connection but never responds leaves the promise pending forever, which wedged the done-summary poller (its finally never ran, so slackDonePolling stayed true for the process lifetime), hung the loopback /reply handler, and silently dropped inbound file messages that had already been 200-acked — the poller's designed transient-retry path never ran because a stall produces no error at all. Arm req.setTimeout (12s, matching fetchText.ts) that destroys the request so the existing 'error' handlers settle the promises through the usual transient-failure path: postSlackReply resolves ok:false (poller retries), downloadSlackFile resolves null (attachment dropped, message still forwarded). Regression coverage: test/slack-timeout.test.cjs drives the real postSlackReply against a stalled local TLS endpoint (fails on unfixed code) and pins the download timeout by source check; the full end-to-end stall scenario (poller wedge, /reply hang, acked-then-dropped message) lives in test/repro/bug-12.repro.cjs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What & why
postSlackReply and downloadSlackFile used the default fetch with no timeout. A hung Slack API or CDN connection would block the calling thread indefinitely. The fix adds AbortSignal.timeout(15_000) to both calls.
Type of change
Evidence
Before
After
How I tested it
node --test test/slack-timeout.test.cjsagainst unfixedmain— regression tests fail (red).npm run typecheckclean.Credit (optional)
Discord: ttawdtt
X:
Checklist
npm run typecheckpasses.npm run test:focusedpasses (except pre-existing Windows-env failures unrelated to this change, identical on clean main).npm run buildsucceeds.DESIGN.md/tokens.ts— no ad-hoc colors, spacing, or fonts.ATTRIBUTION.md.