spotify / spotify/confidence-resolver
JS local provider should recover after initial CDN state fetch failure
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16
- Forks
- 14
- Avg merge
- 2d 7m
- Merged PRs (30d)
- 40
Description
Problem
The JavaScript local provider retries CDN state requests during initialization, but the retries are bounded by initializeTimeout (30 seconds by default). If no state is fetched before that deadline, initialize() rejects, the provider enters ERROR, and the background state-refresh scheduler is never started.
A transient CDN outage at process startup therefore requires application-level reinitialization or a restart.
Intended behavior
Match the Java local provider startup behavior:
- Initialization should return without waiting indefinitely for CDN state.
- The provider should remain
NOT_READYwhile no valid state is available. - Flag evaluations should return the caller supplied default with a provider-not-ready error.
- A background task should retry state fetching every 1 second while
NOT_READY. - After valid state is loaded, transition to
READYand use the configured normal state update interval. - Closing the provider must cancel in-flight requests and retry scheduling.
- Preserve the existing retry handling for transient network errors, 408, 429, and 5xx responses.
Acceptance criteria
- A startup CDN outage does not cause permanent
ERRORstate. - Recovery happens automatically without calling
initialize()again. - Tests cover an unreachable CDN, repeated retry, recovery to
READY, default-value evaluation whileNOT_READY, and shutdown cancellation. - Existing behavior after a state has already been loaded remains unchanged.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the JavaScript local provider's initialize(), state-refresh scheduler, flag-evaluation path, and close() handling; compare startup behavior with the Java local provider. Add tests for an unreachable CDN, repeated retries, recovery to READY, default-value evaluation while NOT_READY, and shutdown cancellation, then verify existing post-load behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100