(janitor/dedupe): consolidate fetch-with-timeout helper in web worker clients - #5926
Merged
Merged
Conversation
… clients Three web worker clients (auto-fix, auto-triage, code-review) each carried an identical timeout-only `fetchWithTimeout` helper. Extract the shared helper into lib/fetch-with-timeout.ts and have each client pass its own timeout, so a timeout-handling fix is applied once instead of three times. No behavior change.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 79.4K · Output: 6.2K · Cached: 120.7K Review guidance: REVIEW.md from base branch |
eshurakov
approved these changes
Sep 7, 2026
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.
Summary
Three web worker clients in
apps/webeach carried an identical, timeout-onlyfetchWithTimeouthelper:lib/auto-fix/client/auto-fix-worker-client.tslib/auto-triage/client/triage-worker-client.tslib/code-reviews/client/code-review-worker-client.tsThe three copies were byte-for-byte identical apart from their default timeout
(10s, 10s, 30s). Any future fix to the abort/timeout handling would have to be
applied in three places and would be easy to miss in one.
Change
Extract the shared helper into
lib/fetch-with-timeout.tsand have each clientimport it and pass its own timeout explicitly.
fetchWithTimeout(url, options, timeoutMs)now lives in one module.user-deployments/fetch-utils.tsretry-awarefetchWithTimeoutis leftuntouched: it layers retry/backoff on top and serves a different contract, so
folding it in would have changed dispatch behavior (introducing retries).
Verification
tsgo --noEmit -p apps/web/tsconfig.json— cleanoxlinton the four changed files — 0 warnings, 0 errorsoxfmton the four changed filesNo behavior change: each caller still uses its original timeout.