Closed
Description
Feature flags are provided by IFeatureFlagProvider.
FeatureManagement-JavaScript/src/featureProvider.ts
Lines 7 to 18 in b70bbd3
We have two impl of feature flag providers for map-based and object-based usage. Data source can be arbitrary data but none of them validate whether a feature flag is valid according to the schema, which is not as robust as expected.
Two follow-up actions:
- In our built-in IFeatureFlagProvider impl, add validation and throw errors when data source itself is invalid.
- As customers can impl their own provider (potentially provide invalid data), in our impl of public APIs like
isEnabled
andgetVariant
, we can add validation after getting a feature flag from the provider, ensure we don't encounter unexpected error later.