Skip to content

Spike: Define retry/resilience policy and auth/session + multisig state lifecycle #79

Description

@meshackyaro

Description

Two related resilience/lifecycle gaps:

  1. Dead retry code. src/utils/retry.ts implements a generic retry() helper, but it is never called anywhere in src/ — no Soroban RPC call (stellar/rpc.ts's simulateAndAssemble) and no backend fetch (auth/challenge.ts) has any retry, timeout, or handling of transient errors (rate limits, simulation TRY_AGAIN_LATER states). The README's own roadmap lists "Auto-retry logic for RPC endpoints" as unimplemented.

  2. Incomplete session/multisig state. auth/session.ts persists the auth token to localStorage only — silently a no-op outside a browser, so Node.js/CLI/backend integrators get no persistence at all — and the token carries no expiry metadata, so nothing re-triggers the challenge flow on a 401. Separately, MultiSigEscrowClient (src/escrow/multisig.ts) keeps in-progress multisig operation state in an in-memory Map, but per the README, signers are expected to "submit their signed XDR independently" — which can't work if the state coordinating them only exists in one process's memory.

Component

SDK

Difficulty

🟣 Spike — investigation required, scope not yet defined

Tasks

  • Define where retry() should actually apply, respecting idempotency differences between simulate (safe to retry) and submit (not safely retryable)
  • Design a Node-vs-browser-aware session storage strategy and a token-expiry/401 re-auth flow
  • Design where multisig operation state should live so independent signer processes can coordinate (backend API? on-chain? a relay service?)
  • Prototype the chosen retry policy and multisig state strategy

Acceptance Criteria

  • A written recommendation for the retry policy, with idempotency rules per call type
  • A written recommendation for session storage and token lifecycle across Node/browser
  • A written recommendation for multisig operation-state coordination
  • Follow-up implementation issue(s) filed
  • Any blocking unknowns flagged

Estimated Time

1-2 days (time-boxed spike)

Metadata

Metadata

Assignees

Labels

difficulty: spikeResearch/investigation issue — scope and approach are not yet definedpriority: highHigh priority issuequestionFurther information is requestedreliabilitysdk

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions