fix(miner): bound the AMS export POST with a request timeout (#7237) - #7267
Conversation
|
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 #7267 +/- ##
=======================================
Coverage 93.81% 93.81%
=======================================
Files 704 704
Lines 69454 69455 +1
Branches 18897 18897
=======================================
+ Hits 65158 65159 +1
Misses 3302 3302
Partials 994 994
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-19 11:34:23 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed 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.
|
Summary
orb-export.js'ssendAmsExportBatchPOSTed the anonymized telemetry batch to the AMS collector with norequest timeout — a hung or black-holed collector could stall the export indefinitely (and, since the
export runs inside the miner loop, back-pressure it).
This bounds the single request with
signal: AbortSignal.timeout(timeoutMs), added to the existingfetchFninit object without touching
method/headers/body.timeoutMsis a new option defaulting to a newexported
DEFAULT_ORB_EXPORT_TIMEOUT_MS(10_000— matching this package's other default request timeouts inlive-issue-snapshot.js/opportunity-fanout.js), so every real invocation is bounded automatically withoutrunOrbExportClipassing anything. A timeout surfaces as a thrownAbortError/TimeoutErrorthat theexisting
catchalready turns into{ sent: 0, error }— no new catch branch, and no retry logic added.Closes #7237
Scope
.d.ts+ its test); nosite//CNAME/lovable; no new dependency.Closes #7237).Validation
git diff --checknpm run typecheck(root — clean;.d.tsupdated with the new export +timeoutMsoption)npm run test:coverage— 100% of the changed lines + branches covered. New regressions: the requestinit carries an
AbortSignal(default and explicittimeoutMs),DEFAULT_ORB_EXPORT_TIMEOUT_MS === 10_000,and an aborted (timed-out) request is caught into
{ sent: 0, error }without throwing. Existing tests pass unchanged.npm run build:miner(node --checkpasses).If any required check was skipped, explain why:
packages/loopover-miner/lib/**; CI runs the full suite.Safety