Skip to content

[Fix] DeFindex errors silently swallowed in orchestration.ts returning partial data as HTTP 200 #234

Closed

Description

@collinsezedike

Description

In packages/stellar-sdk-helpers/src/orchestration.ts:58, the catch block around fetchDefindexPosition logs a warning and continues, returning only Blend positions to the caller. The caller (the API route) receives an HTTP 200 response with DeFindex balances silently omitted.

There is no partial-data signal in the response -- callers cannot distinguish a complete result from one where DeFindex fetching failed.

Steps to Reproduce

  1. Set VAULT_CONTRACT_ID to a value that causes fetchDefindexPosition to throw (wrong contract ID, RPC timeout, etc.).
  2. Call the positions API endpoint.
  3. Observe HTTP 200 with Blend positions only -- no error, no indication DeFindex data is missing.

Expected Behavior

The caller receives a clear signal that the result is partial -- either a non-200 status, a typed partial-data flag in the response body, or a rethrown error.

Actual Behavior

All fetchDefindexPosition errors are caught and discarded. The caller gets a successful response containing only Blend data.

Environment

Field Value
Network testnet / mainnet
Protocol affected DeFindex
Node.js >=24
pnpm 9.x

Possible Cause / Fix

Either rethrow the error (letting the API route return a 5xx), or add a partial: true flag to the response type and surface it to callers so they can handle it explicitly.

Activity

  1. added
    bugSomething isn't working
    trivialSelf-contained task, completable in < 2 hours with no deep protocol knowledge required
    apiAdds or modifies a REST endpoint in apps/api
    sdkInvolves Blend or DeFindex SDK helpers in packages/stellar-sdk-helpers
    on Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAdds or modifies a REST endpoint in apps/apibugSomething isn't workingsdkInvolves Blend or DeFindex SDK helpers in packages/stellar-sdk-helperstrivialSelf-contained task, completable in < 2 hours with no deep protocol knowledge required

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions