Difficulty: Intermediate
Type: feature, resilience
Background
The SDK relies on The Graph (subgraphs) to fetch indexed on-chain data. Currently, if a query fails due to a temporary gateway timeout, the SDK instantly throws an error.
Problem
Network hiccups or subgraph syncing delays cause intermittent UI failures for downstream applications. Developers are forced to implement their own retry wrappers.
Expected outcome
The SDK's data-fetching module includes an automated retry mechanism utilizing exponential backoff to handle transient network errors gracefully.
Suggested implementation
- Modify the internal fetch client to accept
retries and retryDelay configuration parameters.
- Implement a loop/recursion that captures 50x HTTP errors or network timeouts and retries the request.
- Wait exponentially longer between subsequent retries (e.g., 500ms, 1s, 2s).
Acceptance criteria
Likely affected files/directories
Requirements
- The retry logic must be configurable (allow developers to opt-out by setting retries to 0).
Difficulty: Intermediate
Type: feature, resilience
Background
The SDK relies on The Graph (subgraphs) to fetch indexed on-chain data. Currently, if a query fails due to a temporary gateway timeout, the SDK instantly throws an error.
Problem
Network hiccups or subgraph syncing delays cause intermittent UI failures for downstream applications. Developers are forced to implement their own retry wrappers.
Expected outcome
The SDK's data-fetching module includes an automated retry mechanism utilizing exponential backoff to handle transient network errors gracefully.
Suggested implementation
retriesandretryDelayconfiguration parameters.Acceptance criteria
Likely affected files/directories
src/api/graphqlClient.tsRequirements