Fix: Validate retry configuration at client and request level#104
Open
zeke-codes wants to merge 2 commits into
Open
Fix: Validate retry configuration at client and request level#104zeke-codes wants to merge 2 commits into
zeke-codes wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added fail-fast validation for retry configuration at both SDK config level and HTTP client level.
This ensures invalid retry settings (negative retries, invalid delays, maxDelay < baseDelay, and invalid retryable status arrays) are rejected early with a clear GuildPassError, preventing silent retry misbehavior or infinite retry loops.
Semver impact: patch
Linked Issue
Closes #57
Type of Change
Changes Made
Public API Changes
None
Test Evidence
npm run lint: 1 error (fixed apiKey issue + remaining warnings unrelated to this PR)
npm run test: all tests passing
Build Evidence
npm run build: succeeded (no errors)
Checklist
pnpm typecheckpassespnpm lintpassespnpm test:runpasses — all tests greenpnpm buildsucceeds —dist/generated cleanlydocs/updated if public API changedexamples/updated if new usage patterns were addedAdditional Notes
This change focuses on defensive validation of retry configuration to ensure deterministic and safe retry behavior across both SDK-level and request-level configurations.