Skip to content

Make TransactionFailedExtras result_codes.operations optional (breaking type fix) #1527

Description

@Ryang-21

What

In HorizonApi.TransactionFailedExtras, result_codes.operations is typed as required (operations: string[]), but Horizon omits the field when a transaction fails a transaction-level check (e.g. tx_bad_seq) and no operations were evaluated — verified against a live network in #1526. The type should be operations?: string[] to match the wire format.

Why deferred

Making the field optional is a source-breaking TypeScript change under strictNullChecks: existing unguarded reads like result_codes.operations.map(...) stop compiling. #1526 shipped the runtime-safe parts instead — TransactionFailedError.getResultCodes() normalizes the omitted field to [] — and deferred the wire-type fix to the next major release. The field carries a doc comment with a TODO(next major) marker in src/horizon/horizon_api.ts.

To do (next major)

  • Change operations: string[] to operations?: string[] in TransactionFailedExtras and remove the TODO comment
  • Mark as breaking in the changelog

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
Backlog (Not Ready)

Relationships

None yet

Development

No branches or pull requests

Issue actions