Skip to content

fix(#674): add configurable timeout to all network requests in SDK client#815

Merged
Haroldwonder merged 2 commits into
Haroldwonder:mainfrom
devSoniia:fix/674-rn-client-timeout
Jun 7, 2026
Merged

fix(#674): add configurable timeout to all network requests in SDK client#815
Haroldwonder merged 2 commits into
Haroldwonder:mainfrom
devSoniia:fix/674-rn-client-timeout

Conversation

@devSoniia

Copy link
Copy Markdown
Contributor

Summary

Resolves #674

submitTransaction() and other methods in sdk/src/client.ts made network calls to the Soroban RPC server without any timeout. On mobile networks with poor connectivity, requests could hang indefinitely.

Changes

  • Added optional timeoutMs field to SwiftRemitClientOptions (default: 30 seconds)
  • Added private withTimeout<T>() helper using Promise.race to enforce the timeout
  • Applied withTimeout() to all RPC calls in prepareTransaction, submitTransaction, and simulateCall

Usage

const client = new SwiftRemitClient({
  contractId: '...',
  networkPassphrase: Networks.TESTNET,
  rpcUrl: 'https://soroban-testnet.stellar.org',
  timeoutMs: 15, // 15 seconds instead of the default 30
});

…ts in SDK client

On mobile networks with poor connectivity, requests to the Soroban RPC
server could hang indefinitely. Added a configurable timeout (default 30s)
that wraps every network call (getAccount, simulateTransaction,
sendTransaction, getTransaction) using Promise.race.

- Added timeoutMs option to SwiftRemitClientOptions (default 30s)
- Added withTimeout() helper that rejects after the configured duration
- Applied timeout to prepareTransaction, submitTransaction, and simulateCall

Closes Haroldwonder#674
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@devSoniia is attempting to deploy a commit to the Harold's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 7, 2026

Copy link
Copy Markdown

@devSoniia Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Haroldwonder Haroldwonder merged commit 2de9139 into Haroldwonder:main Jun 7, 2026
4 of 19 checks passed
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.

sdk/react-native/src/client.ts SwiftRemitRNClient does not handle network timeouts

2 participants