fix(miner-extension): bound the ranked-candidates sync fetch with a timeout - #7051
Conversation
…imeout
syncRankedCandidatesFromMinerUi's fetch had no timeout, unlike the
established pattern elsewhere in the codebase. This sync runs on a
10-minute alarm, so a hung local miner-ui connection would leave that
alarm invocation hanging indefinitely instead of failing fast and
letting the next scheduled attempt retry. The existing try/catch already
resolves any thrown/aborted fetch to the function's typed { ok: false }
result, so a timeout now degrades cleanly rather than throwing.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 20:03:10 UTC
Review summary Nits — 4 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. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 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.
|
Summary
apps/loopover-miner-extension/background.js'ssyncRankedCandidatesFromMinerUicalledfetchwith no timeout orAbortController, unlike the established pattern inreview-enrichment/src/external-fetch.ts. This sync runs on a 10-minute alarm, so a hung connection (e.g. the local miner-ui process running but unresponsive) would leave that alarm invocation hanging indefinitely instead of failing fast and letting the next scheduled attempt retry.RANKED_CANDIDATES_FETCH_TIMEOUT_MS = 3000constant (short, since this is a same-machine localhost call, not a remote round-trip) and wiressignal: AbortSignal.timeout(...)into the fetch call.{ ok: false, error, minerUiUrl }shape — no new error handling was needed to satisfy the "never throws" contract.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #7007
Validation
git diff --checknpm run lint --workspace @loopover/miner-extension(this workspace's ownnode --checklint/typecheck)npm run test --workspace @loopover/miner-extension— 24/24 passing with coverage: 100% statements/lines, 95.79% branches onbackground.js(identical to the pre-existing baseline; all uncovered lines are unrelated pre-existing branches, not part of this diff)npm run actionlint/ whole-reponpm run typecheck(not applicable — this is an isolated browser-extension workspace with its own lint/test scripts, unaffected by backend changes)npm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm run ui:openapi:check(not applicable to this extension-only change)npm audit --audit-level=moderate(no dependency changes)If any required check was skipped, explain why:
apps/loopover-miner-extension/**, which has its own isolatedlint/testscripts (run above, both green) and no dependency on the backend build/typecheck pipeline. The whole-repoactionlint/typecheckand MCP/Worker/OpenAPI checks have no surface to exercise for a change scoped to one fetch call in one browser-extension module.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots. (N/A — no visible UI change; this is a background-alarm timeout fix.)