Skip to content

Add Retry and Backoff to SDK Event Subscription #775

Description

@Mosas2000

Description

The SDK event subscription does not back off on failure. sdk/src/client.ts subscribeToEvents polls on a fixed interval (pollIntervalMs ?? 5000) and on error only calls onError before immediately retrying at the same cadence, with no exponential backoff or jitter. Repeated failures can hammer the RPC.

This is distinct from #677 (SDK workspaces/CI onboarding and typed wrappers), which addresses build integration, not subscription resilience.

Requirements and context

  • Implement exponential backoff with jitter on polling failures
  • Cap backoff at a configurable maximum
  • Reset backoff after a successful poll
  • Surface backoff state via the subscription options
  • Add tests covering backoff progression and reset

Suggested execution

Fork the repo and create a branch

git checkout -b feature/sdk-event-backoff

Implement changes

  • Add backoff/jitter to the event poll loop
  • Add configuration for max backoff
  • Add comprehensive tests

Example commit message

feat: add retry and backoff to SDK event subscription

Guidelines

  • Assignment required before starting
  • PR must include a closing reference to this issue
  • Timeframe: 72 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions