feat(core): add config validation, defaults, and httpConfig extraction#1157
Open
feat(core): add config validation, defaults, and httpConfig extraction#1157
Conversation
2 tasks
d6f2a89 to
915c8e3
Compare
7a0b957 to
f631f9f
Compare
eedad38 to
36997ac
Compare
04bb992 to
658e649
Compare
1a577e8 to
c451d38
Compare
3a16620 to
f3e71c3
Compare
b1cd5f5 to
ff837e7
Compare
f3e71c3 to
55221f4
Compare
ff837e7 to
a3ac0e5
Compare
09d48d7 to
a6127cc
Compare
a6127cc to
f76fd78
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>
… validation Remove autoFlushOnRetryReady from defaultConfig (redundant with TimerFlushPolicy). Validate integrations field from CDN response before storing — falls back to defaultSettings when CDN returns null, array, or non-object integrations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f76fd78 to
e1fb9cd
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