Skip to content

SubmitTransactionAsync throws exception for valid PENDING responses (HTTP 201) #61

@sergei-stronghold

Description

@sergei-stronghold

Issue
The SubmitTransactionAsync method throws SubmitTransactionUnknownResponseException when receiving valid HTTP 201 Created responses with PENDING status from Horizon's asynchronous transaction submission endpoint.

Details

  • This SDK only handles traditional synchronous responses (HTTP 200, 400, 504) in the transaction submission logic
  • Horizon's POST /transactions_async endpoint returns HTTP 201 Created with body: {"tx_status": "PENDING", "hash": "..."}
  • The SDK treats this valid response as an "unknown response" and throws an exception
  • The issue most likely is located at:
    switch (response.StatusCode)

Impact
Developers cannot use the SDK to submit transactions to modern Horizon instances that return PENDING responses. This affects all mainnet usage where the async endpoint is now standard.

Solution
Update SubmitTransactionAsync to recognize and properly handle HTTP 201 Created responses with PENDING status, returning a response object that includes the transaction hash and pending status indicator.

Reproduction

// This throws SubmitTransactionUnknownResponseException
var response = await _stellarServer.SubmitTransactionAsync(transaction);

Environment

  • Package Version(s): stellar-dotnet-sdk 13.1.4 and 13.2.0
  • Network: Mainnet
  • Occurs: Consistently when Horizon returns PENDING status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions