Skip to content

fix: skip timeout errors in withRetry via shouldRetry predicate - #239

Merged
collinsezedike merged 1 commit into
mainfrom
fix/withretry-skip-timeout-errors
Jun 25, 2026
Merged

fix: skip timeout errors in withRetry via shouldRetry predicate#239
collinsezedike merged 1 commit into
mainfrom
fix/withretry-skip-timeout-errors

Conversation

@collinsezedike

@collinsezedike collinsezedike commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added shouldRetry: (err: unknown) => boolean parameter to withRetry in packages/shared (default () => true, fully backward-compatible)
  • Added SorobanTimeoutError class in tx.ts -- withSorobanTimeout now throws it instead of a generic Error, making timeout rejections identifiable by type
  • Updated the prepareSorobanTx call site to pass (err) => !(err instanceof SorobanTimeoutError) so withRetry does not retry on deadline-exceeded errors
  • Added two new tests covering the shouldRetry predicate in utils.test.ts

Test plan

  • pnpm lint && pnpm typecheck && pnpm test pass locally
  • withRetry exits immediately on SorobanTimeoutError without issuing a second attempt
  • Existing retry behavior on transient errors is unchanged (all 12 tests in utils.test.ts pass)

Closes #232

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview, Comment Jun 23, 2026 3:07pm

@collinsezedike
collinsezedike merged commit 618b6a2 into main Jun 25, 2026
5 checks passed
@collinsezedike
collinsezedike deleted the fix/withretry-skip-timeout-errors branch June 25, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] withRetry retries Soroban timeout errors and leaves previous requests in-flight

1 participant