fix(review): bound fetchShotContentBlock's screenshot fetch with a timeout - #7098
Conversation
…meout fetchShotContentBlock fetched a screenshot URL with a bare fetch(url) and no time bound, unlike every other external fetch in this file and its siblings -- including resolveShotUrl in this same file, which already uses AbortSignal.timeout(EXTERNAL_SCREENSHOT_FETCH_TIMEOUT_MS). A slow or hanging shot host could stall the review pipeline for that PR indefinitely. Pass the same AbortSignal.timeout to the fetch. A TimeoutError rejection is already handled by the surrounding catch (returns undefined), so no other change is needed. Closes JSONbored#7070
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7098 +/- ##
==========================================
- Coverage 95.98% 93.75% -2.23%
==========================================
Files 609 692 +83
Lines 48144 68808 +20664
Branches 15133 18781 +3648
==========================================
+ Hits 46209 64511 +18302
- Misses 1118 3302 +2184
- Partials 817 995 +178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-17 21:21:48 UTC
Review summary Nits — 4 non-blocking
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
What
fetchShotContentBlock(src/review/visual/capture.ts) fetched a screenshot URL with a barefetch(url)and no time bound. Every other external fetch in this file and its siblings is timeout-bounded — includingresolveShotUrlin this same file, which already usesAbortSignal.timeout(EXTERNAL_SCREENSHOT_FETCH_TIMEOUT_MS)(8s). A slow or hanging shot host (a self-host operator's storage backend, an R2/S3 proxy) could stall the review pipeline for that PR indefinitely.How
Pass the same
AbortSignal.timeout(EXTERNAL_SCREENSHOT_FETCH_TIMEOUT_MS)to the fetch, reusing the constant already declared in this file. The function's existingcatchalready returnsundefinedon any rejection, so aTimeoutErroris handled with no other change.Validation
Test added to the existing
fetchShotContentBlockdescribe block intest/unit/visual-capture.test.ts: the fetch is called with anAbortSignal. Confirmed it fails against the unfixed code (signalisundefined) and passes with the fix.typecheckclean; the fullvisual-capturesuite (118 tests) passes.Closes #7070