feat(core): add config validation, defaults, and httpConfig extraction#1157
Open
abueide wants to merge 2 commits intotapi/types-and-errorsfrom
Open
feat(core): add config validation, defaults, and httpConfig extraction#1157abueide wants to merge 2 commits intotapi/types-and-errorsfrom
abueide wants to merge 2 commits intotapi/types-and-errorsfrom
Conversation
2 tasks
d6f2a89 to
915c8e3
Compare
7a0b957 to
f631f9f
Compare
eedad38 to
36997ac
Compare
6d30565 to
50cad97
Compare
Add config validation utilities (validateRateLimitConfig, validateBackoffConfig), default HTTP config constants, and httpConfig extraction/merging logic in SegmentClient.fetchSettings(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deep-merge statusCodeOverrides so server-sent partial overrides don't replace defaults. Add rateLimitConfig parameter to validateBackoffConfig for the cross-config relational constraint: maxTotalBackoffDuration >= 2x max(maxBackoffInterval, maxRetryInterval). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50cad97 to
04bb992
Compare
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.
Summary
validateRateLimitConfig()andvalidateBackoffConfig()utilities that clamp config values to safe ranges with logger warningsdefaultHttpConfigand new config defaults (retryStrategy,autoFlushOnRetryReady) to constantshttpConfigfield toSegmentClientwithgetHttpConfig()accessor and CDN extraction/merge logic infetchSettings()statusCodeOverridesso server-sent partial overrides extend defaults rather than replacing themmaxTotalBackoffDuration >= 2x max(maxBackoffInterval, rateLimitConfig.maxRetryInterval)PR 2 of 5 in the TAPI backoff/retry stack. Depends on #1156.
Test plan
statusCodeOverrides: { '501': 'drop' }preserves default overrides for 408, 410, 429, 460, 505validateBackoffConfigcross-checks againstrateLimitConfig.maxRetryInterval🤖 Generated with Claude Code