Skip to content

fix(review): bound fetchShotContentBlock's screenshot fetch with a timeout - #7098

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/shot-content-block-fetch-timeout-7070
Jul 17, 2026
Merged

fix(review): bound fetchShotContentBlock's screenshot fetch with a timeout#7098
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/shot-content-block-fetch-timeout-7070

Conversation

@shin-core

Copy link
Copy Markdown
Contributor

What

fetchShotContentBlock (src/review/visual/capture.ts) fetched a screenshot URL with a bare fetch(url) and no time bound. Every other external fetch in this file and its siblings is timeout-bounded — including resolveShotUrl in this same file, which already uses AbortSignal.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 existing catch already returns undefined on any rejection, so a TimeoutError is handled with no other change.

Validation

Test added to the existing fetchShotContentBlock describe block in test/unit/visual-capture.test.ts: the fetch is called with an AbortSignal. Confirmed it fails against the unfixed code (signal is undefined) and passes with the fix. typecheck clean; the full visual-capture suite (118 tests) passes.

Closes #7070

…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
@shin-core
shin-core requested a review from JSONbored as a code owner July 17, 2026 20:52
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 17, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.75%. Comparing base (05e7af4) to head (ead6fdd).
⚠️ Report is 7 commits behind head on main.

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     
Flag Coverage Δ
shard-1 43.34% <0.00%> (ø)
shard-2 36.89% <0.00%> (ø)
shard-3 33.16% <100.00%> (ø)
shard-4 34.39% <100.00%> (ø)
shard-5 31.67% <0.00%> (-0.01%) ⬇️
shard-6 46.07% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/visual/capture.ts 94.90% <100.00%> (ø)

... and 83 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-17 21:21:48 UTC

2 files · 1 AI reviewer · no blockers · CI green · unstable

⏸️ Suggested Action - Manual Review

Review summary
Small, targeted fix that adds the existing EXTERNAL_SCREENSHOT_FETCH_TIMEOUT_MS AbortSignal.timeout to fetchShotContentBlock's fetch call, mirroring resolveShotUrl in the same file. The existing catch already treats any rejection (including TimeoutError) as undefined, so no other behavior changes, and a test verifies the signal is passed. This closes issue #7070 as described and is a correct, minimal, well-scoped change.

Nits — 4 non-blocking
  • The added comment in capture.ts is a bit verbose for a one-line change; a shorter inline note would suffice.
  • The test only asserts that a signal is passed, not that it's specifically an AbortSignal.timeout with the correct duration — consider asserting on the constant value too.
  • src/review/visual/capture.ts: consider extracting the fetch+timeout pattern into a small helper if a third call site needing this timeout appears, to avoid repeating the AbortSignal.timeout(...) call.
  • test/unit/visual-capture.test.ts: could assert the timeout duration matches EXTERNAL_SCREENSHOT_FETCH_TIMEOUT_MS for stronger coverage.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7070
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 61 registered-repo PR(s), 37 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor shin-core; Gittensor profile; 61 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: shin-core
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 61 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@JSONbored
JSONbored merged commit 89c3ab1 into JSONbored:main Jul 17, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fetchShotContentBlock's screenshot fetch has no AbortSignal.timeout, unlike this file's own resolveShotUrl fetch

2 participants