As a user I want to consistently see features enabled by the remote flag system.
Solution: Add a 3x retry option to the constructor base on these guidelines.
/**
* Constructs a new ClientConfigApiService object.
*
* @deprecated This signature is deprecated; please use the `onBreak` and
* `onDegraded` methods instead.
* @param args - The arguments.
* @param args.fetch - A function that can be used to make an HTTP request.
* If your JavaScript environment supports `fetch` natively, you'll probably
* want to pass that; otherwise you can pass an equivalent (such as `fetch`
* via `node-fetch`).
* @param args.retries - Number of retry attempts for each fetch request.
* @param args.maximumConsecutiveFailures - The maximum number of consecutive
* failures allowed before breaking the circuit and pausing further fetch
* attempts.
* @param args.circuitBreakDuration - The amount of time to wait when the
* circuit breaks from too many consecutive failures.
* @param args.onBreak - Callback for when the circuit breaks, useful
* for capturing metrics about network failures.
* @param args.onDegraded - Callback for when the API responds successfully
* but takes too long to respond (5 seconds or more).
* @param args.config - The configuration object, includes client,
* distribution, and environment.
* @param args.config.client - The client type (e.g., 'extension', 'mobile').
* @param args.config.distribution - The distribution type (e.g., 'main',
* 'flask').
* @param args.config.environment - The environment type (e.g., 'prod', 'rc',
* 'dev').
*/
constructor(args: {
fetch: typeof fetch;
retries?: number;
maximumConsecutiveFailures?: number;
circuitBreakDuration?: number;
onBreak?: () => void;
onDegraded?: () => void;
config: {
client: ClientType;
distribution: DistributionType;
environment: EnvironmentType;
};
});
What is this about?
As a user I want to consistently see features enabled by the remote flag system.
Issue: Currently the feature flag controller doesn't support a retry on the failure of an API call.
Solution: Add a 3x retry option to the constructor base on these guidelines.
Scenario
No response
Design
No response
Technical Details
No response
Threat Modeling Framework
No response
Acceptance Criteria
No response
Stakeholder review needed before the work gets merged
References
No response