⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
queryDiscoveryIndex in packages/loopover-miner/lib/discovery-index-client.ts (~line 108) has a
bare catch block:
} catch {
return EMPTY_QUERY_RESPONSE;
}
Any fetch/network/parse failure is silently dropped with zero logging, even at --verbose.
Its sibling submitSoftClaim in the same file, doing the equivalent best-effort fire-and-forget
network call, logs the failure before returning its own fail-open result:
} catch (error) {
getLogger().debug("discovery_plane_soft_claim_failed", { error: describeCliError(error) });
return { sent: false };
}
queryDiscoveryIndex's own doc comment area references mirroring orb-export.js's
sendAmsExportBatch convention — but that function actually surfaces the error in its return
value, and queryDiscoveryIndex's EMPTY_QUERY_RESPONSE return type has no slot for one, so a
debug log (matching submitSoftClaim's approach) is the correct fix, not a return-shape change.
Requirements
queryDiscoveryIndex's catch block must log the failure via getLogger().debug(...) before
returning EMPTY_QUERY_RESPONSE, using the same describeCliError(error) shape
submitSoftClaim already uses, with a distinct event name for this function (e.g.
"discovery_plane_query_failed", mirroring submitSoftClaim's
"discovery_plane_soft_claim_failed" naming convention).
- Change
catch { ... } to catch (error) { ... } so the error value is available to log.
- Do not change
queryDiscoveryIndex's return type or its fail-open behavior (still returns
EMPTY_QUERY_RESPONSE on any failure) — only add the log line.
- Do not change
submitSoftClaim — it is already correct and is the precedent.
Deliverables
Both deliverables are required in this single PR.
Test Coverage Requirements
This repo enforces 99%+ Codecov patch coverage, branch-counted, on all changed lines/branches
(applies to packages/loopover-miner/lib/**). The new log line and its test must be covered.
Expected Outcome
A queryDiscoveryIndex failure (network error, non-OK response is already handled separately,
this is specifically the throw path) now leaves a debug-level log trace, matching the visibility
submitSoftClaim already provides for its own best-effort network call, instead of failing
completely silently even at --verbose.
Links & Resources
packages/loopover-miner/lib/discovery-index-client.ts (queryDiscoveryIndex ~line 108;
submitSoftClaim ~lines 121-153, the precedent to mirror)
Context
queryDiscoveryIndexinpackages/loopover-miner/lib/discovery-index-client.ts(~line 108) has abare catch block:
Any fetch/network/parse failure is silently dropped with zero logging, even at
--verbose.Its sibling
submitSoftClaimin the same file, doing the equivalent best-effort fire-and-forgetnetwork call, logs the failure before returning its own fail-open result:
queryDiscoveryIndex's own doc comment area references mirroringorb-export.js'ssendAmsExportBatchconvention — but that function actually surfaces the error in its returnvalue, and
queryDiscoveryIndex'sEMPTY_QUERY_RESPONSEreturn type has no slot for one, so adebug log (matching
submitSoftClaim's approach) is the correct fix, not a return-shape change.Requirements
queryDiscoveryIndex's catch block must log the failure viagetLogger().debug(...)beforereturning
EMPTY_QUERY_RESPONSE, using the samedescribeCliError(error)shapesubmitSoftClaimalready uses, with a distinct event name for this function (e.g."discovery_plane_query_failed", mirroringsubmitSoftClaim's"discovery_plane_soft_claim_failed"naming convention).catch { ... }tocatch (error) { ... }so the error value is available to log.queryDiscoveryIndex's return type or its fail-open behavior (still returnsEMPTY_QUERY_RESPONSEon any failure) — only add the log line.submitSoftClaim— it is already correct and is the precedent.Deliverables
queryDiscoveryIndex's catch block logs the failure viagetLogger().debug(...)withdescribeCliError(error), matchingsubmitSoftClaim's pattern, before returningEMPTY_QUERY_RESPONSE.queryDiscoveryIndexstillreturns
EMPTY_QUERY_RESPONSE(unchanged fail-open behavior) AND the logger's debug methodwas called with the expected event name (mock/spy on the logger, mirroring however the
existing
submitSoftClaimtest verifies its own log call, if one exists — if no such testexists yet for
submitSoftClaim, write this test using a direct spy ongetLogger()).Both deliverables are required in this single PR.
Test Coverage Requirements
This repo enforces 99%+ Codecov patch coverage, branch-counted, on all changed lines/branches
(applies to
packages/loopover-miner/lib/**). The new log line and its test must be covered.Expected Outcome
A
queryDiscoveryIndexfailure (network error, non-OK response is already handled separately,this is specifically the throw path) now leaves a debug-level log trace, matching the visibility
submitSoftClaimalready provides for its own best-effort network call, instead of failingcompletely silently even at
--verbose.Links & Resources
packages/loopover-miner/lib/discovery-index-client.ts(queryDiscoveryIndex~line 108;submitSoftClaim~lines 121-153, the precedent to mirror)