core
core copied to clipboard
Feat/create minute exponential backoff
Explanation
This PR pushes for a retry to be called an exponential backoff by the minute. The remote feature flag controller will automatically: Make an initial API request If it fails, wait 1 minute and retry If that fails, wait 2 minutes and retry If that fails, wait 4 minutes and retry After 3 failed retries (4 total attempts), the circuit breaker will prevent further attempts for a period.
References
Checklist
- [X] I've updated the test suite for new or updated code as appropriate
- [X] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [X I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
- [X] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
[!NOTE] Adds optional per-retry custom backoff intervals to
ClientConfigApiServicewith validation and tests; defaults to exponential backoff when not provided.
- ClientConfig API Service (
src/client-config-api-service/client-config-api-service.ts)
- Add optional
customBackoffInterval(seconds) to constructor for precise per-retry delays.- Implement
CustomIntervalBackoffand integrate viacreateServicePolicy({ backoff }).- Validate intervals (non-empty, positive numbers, length equals
retries); throw descriptive errors.- Default to
ExponentialBackoffwhen no custom intervals are provided.- Minor: make several private fields
readonly; JSDoc improvements.- Tests (
client-config-api-service.test.ts)
- Add coverage for custom intervals usage, validation errors, and fallback to exponential backoff.
- Utility
createMockFetchdefaults and behavior adjusted for tests.- Controller (
src/remote-feature-flag-controller.ts)
- Minor: mark fields
readonly; comment cleanups.- Changelog
- Document custom backoff interval support and defaults.
Written by Cursor Bugbot for commit 7d074edba60a59b82497a727c97375172d4e7dea. This will update automatically on new commits. Configure here.