Skip to content

Preserve both retry and hook configuration #54

@grantfox-oss

Description

@grantfox-oss

Summary

Fix client configuration so retry and hooks can be used together. This matters because production users may want retries and observability lifecycle hooks at the same time.

Current Behaviour

GuildPassClient passes this.config.retry || this.config.hooks into HttpClient. Because HttpClient accepts a single configOrHooks argument, only one of these behaviours can be configured at a time.

Expected Behaviour

The SDK should allow global retry configuration and HTTP lifecycle hooks to be enabled together without one silently overriding the other.

Suggested Implementation

Replace the overloaded configOrHooks constructor parameter with a single options object such as { retry, hooks, fetch } or separate explicit constructor parameters. Update GuildPassClient and tests accordingly.

Files or Areas Likely Affected

  • src/client/GuildPassClient.ts
  • src/http/httpClient.ts
  • src/http/http.types.ts
  • src/config/sdkConfig.ts
  • tests/client.test.ts
  • tests/httpClient.test.ts

Acceptance Criteria

  • A client can be configured with both retry and hooks
  • Retry behaviour still works when hooks are present
  • Hook callbacks still run when retry config is present
  • Existing client configuration remains backwards-compatible where possible
  • Tests cover retry-only, hooks-only, and retry-plus-hooks configurations

Additional Notes

This is a public constructor design change. Prefer a backwards-compatible migration path if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't working

    Type

    No type
    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