Skip to content

Send and receive payments: handle TRY_AGAIN_LATER and DUPLICATE in the RPC example #2963

Closed

Description

@oceans404

Page: https://developers.stellar.org/docs/build/guides/transactions/send-and-receive-payments
File: docs/build/guides/transactions/send-and-receive-payments.mdx:134-141

What's wrong:
The JS example's own comment says DUPLICATE and TRY_AGAIN_LATER "would have to be handled accordingly", then the code throws on any status other than PENDING. Readers copy the throw, not the comment.

Change needed:
Handle the two statuses in the example, or link a page that shows how (see #2962).

Correct reference:

How to check the fix:

  • Run the payment example against testnet with @stellar/stellar-sdk 17.x: the payment succeeds.
  • Sending two payments from one account back to back doesn't throw on TRY_AGAIN_LATER.
  • pnpm validate passes.

Why it matters: Payment code is where a mishandled retry turns into a double payment.

Related: #2962 (same send handling in the shared submitTx helper), #2564 (cross-links to the SDK docs; this page is in its list).

Activity

  1. stellar-doxie commented on Nov 1, 2026

    @stellar-doxie
    Contributor

    🤖 Automated message from the Stellar Triage Bot.

    I saw this issue. I will not work it unless a maintainer calls me in.

    How to reach me:

    • Anyone with write permission can call me in. Comment /triage, add the bot:take label, or assign @kaankacar, @ElliotFriend or @wmendes.
    • On a Raven-filed issue, the raven label also calls me in.
    • The issue author can send me away with /triage stop. People with write permission can also add the bot:hands-off label.
  2. added
    bot:take
    on Nov 1, 2026
  3. oceans404 commented on Nov 1, 2026

    @oceans404
    ContributorAuthor

    /triage

  4. stellar-doxie commented on Nov 1, 2026

    @stellar-doxie
    Contributor

    🤖 Automated message from the Stellar Triage Bot.

    Working this because @oceans404 added bot:take.

    I am checking the claims against the SDK and the live page now. I will report back with a PR or a question.

  5. stellar-doxie commented on Nov 1, 2026

    @stellar-doxie
    Contributor

    🤖 Automated message from the Stellar Triage Bot.

    Working this because @oceans404 added bot:take.

    I opened #2978. It handles both statuses in the JS example.

    • TRY_AGAIN_LATER: resend the same signed transaction until maxTime passes.
    • DUPLICATE: wait for the result, like PENDING.
    • Polling now runs until maxTime, so a slow ledger no longer reads as a failed payment.

    The Java and Go tabs have the same pattern. The PR lists them as follow-ups.

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

    bot:takejs-sdk-v17

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions