Skip to content

Add exponential backoff retry and Horizon error decoder in client.ts #974

Closed

Description

@k-deejah

Description: Problem

  1. In src/lib/client.ts (SorobanClient), RPC calls that encounter HTTP 429 (rate limited) or 503 (service unavailable) fail immediately without retrying.
  2. Horizon error response parsing only extracts top-level detail strings, dropping critical extras.result_codes operation codes.
  3. Missing test cases in src/lib/__tests__/mock-client.test.ts asserting retry behavior during network dropouts.

Solution

Implement an automatic retry wrapper with exponential backoff and jitter for transient HTTP 429, 502, 503, and 504 errors. Parse and format extras.result_codes into actionable messages, and add unit tests verifying retry behavior.

Acceptance Criteria

  • Transient RPC failures retry up to 3 times with exponential backoff.
  • Horizon operation error codes (op_underfunded, op_bad_auth) are parsed and exposed.
  • Mock client tests verify retry attempts and backoff timing in src/lib/__tests__/mock-client.test.ts.

Note for Contributors

If you're assigned to this issue, write a clear and detailed description for your pull request. Explain what was changed, why it was needed, how it was implemented, and include any relevant testing or screenshots where applicable.

Activity

  1. added
    bugSomething isn't working
    testsTest coverage, test setup, or test infrastructure
    performanceRendering speed, memory, or bundle size concerns
    architectureCode structure, patterns, or design decisions
    on Oct 14, 2026
  2. area523ufo commented on Oct 15, 2026

    @area523ufo

    Hi! I've submitted a fix with unit tests for this issue in PR #980. Please let me know if any adjustments are needed!

  3. timmyp10111 commented on Oct 15, 2026

    @timmyp10111

    @timmyp10111 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hello Maintainer, I'm a full-stack developer and I'm interested in taking this up. I've gone through the requirements and clearly understood it, kindly assign this issue to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @timmyp10111 to this issue.

  4. Jenola344 commented on Oct 15, 2026

    @Jenola344
    Contributor

    @Jenola344 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi Maitainer, I would love to work on this

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Jenola344 to this issue.

  5. drips-wave commented on Oct 15, 2026

    @drips-wave

    Congratulations, @Jenola344! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @Jenola344: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. drips-wave commented on Oct 26, 2026

    @drips-wave

    This issue has been completed by @Jenola344 as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @Jenola344: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarchitectureCode structure, patterns, or design decisionsbugSomething isn't workingperformanceRendering speed, memory, or bundle size concernstestsTest coverage, test setup, or test infrastructure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions