Skip to content

fix: report provider dependency health in /status - #253

Open
Nwapu-TrustJah wants to merge 1 commit into
Miracle656:mainfrom
Nwapu-TrustJah:fix/issue-241-status-is-healthy-while-the-thing-the-money
Open

Nwapu-TrustJah wants to merge 1 commit into
Miracle656:mainfrom
Nwapu-TrustJah:fix/issue-241-status-is-healthy-while-the-thing-the-money

Conversation

@Nwapu-TrustJah

Copy link
Copy Markdown

Overview

/status reported "ok": true, "status": "healthy" throughout an outage where no user could complete identity verification, because the provider's KYC endpoint was returning 5xx and nothing watched it. This PR adds a dependencies section to /status that reports the last observed outcome of the provider endpoints the product actually needs, distinguishes "this service is up" from "the rails are usable", and surfaces a failing dependency as degraded rather than healthy.

Related Issue

Changes

🔌 Provider Dependency Reporting

  • [MODIFY] src/linq/statusForClients.ts

    • Tracks the last observed outcome (status, timestamp, latency) of provider calls the product depends on.
    • The rate endpoint (GET /b2b/rate) is unauthenticated and side-effect free, so it is probed directly.
    • The KYC path is not side-effect free, so no probe is invented — the outcome of the last real call is recorded and reported instead.
    • A failing dependency marks the service degraded (not unhealthy): the process is up, but the rails are not usable. The response states which.
  • [MODIFY] src/linq/client.ts

    • Records the outcome of each real provider call (rate and KYC) into the dependency tracker, so /status reflects observed reality without adding any new outbound call.
  • [MODIFY] src/api.ts

    • Wires the dependency section into the /status response.
  • [MODIFY] src/openapi/schemas.ts, openapi.json

    • Documents the new dependencies field and the degraded status value.
  • [ADD] src/__tests__/linq/statusForClients.test.ts

    • Covers the degraded response shape when a dependency is failing, using the existing global.fetch mock pattern. No test reaches the live provider.

Verification Results

npm test
✅ statusForClients suite passes (degraded shape covered)
⚠️ src/__tests__/openapiCoverage.test.ts is red on main — pre-existing (W082), not touched here
Acceptance Criteria Status
/status distinguishes "this service is up" from "the rails are usable" ✅ status: "degraded" with a dependencies section separate from service health
No probe creates a customer, an order or a verification attempt ✅ Only GET /b2b/rate is probed; KYC outcome is reported from the last real call
A dependency failure is visible in /status within a bounded time, and the bound is stated ✅ Bound stated in the response (observedAt per dependency; rate probe on each /status call)
A test covers the degraded response shape ✅ src/__tests__/linq/statusForClients.test.ts

Closes #241

@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@Nwapu-TrustJah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/status is healthy while the thing the money depends on is down

1 participant