Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyFilter applied to FeatureFlags #628

Closed
erik-neumann opened this issue Feb 26, 2025 · 2 comments · Fixed by #629
Closed

KeyFilter applied to FeatureFlags #628

erik-neumann opened this issue Feb 26, 2025 · 2 comments · Fixed by #629
Labels
bug Something isn't working

Comments

@erik-neumann
Copy link

After upgrading to 8.1.0 we realized that some of our FeatureFlags do not properly load anymore. Those AppConfiguration instances that do not work anymore all have a KeyFilter (other than KeyFilter.Any) defined. Those with no filter or KeyFilter.Any are fine. Workaround seems to be adding .appconfig.featureflag/* to the KeyFilters.

    .UseFeatureFlags()
    .Select("Prefix:*")
    .Select(".appconfig.featureflag/*"); // We need to add this line to load feature flags properly

These configs are purely Azure AppConfiguration related, no conflicting appconfig.json or other provider setting does exist. I validated by checking the behaviour of config.Providers[].Data.

@zhiyuanliang-ms
Copy link
Contributor

zhiyuanliang-ms commented Feb 26, 2025

Hi, @erik-neumann Sorry for the inconvenience. This is a bug. The reason of the bug is this line.

If you call UseFeatureFlags before calling Select, the feature flag selector (which is set here) will be cleared wrongly.

A better workaround would be calling Select before calling UseFeatureFlags

.Select("Prefix:*")
.UseFeatureFlags();

We will fix this bug as soon as possible.

@zhiyuanliang-ms zhiyuanliang-ms added the bug Something isn't working label Feb 26, 2025
@amerjusupovic amerjusupovic linked a pull request Feb 26, 2025 that will close this issue
@amerjusupovic amerjusupovic reopened this Feb 26, 2025
@amerjusupovic
Copy link
Member

Version 8.1.1 is now released with the fix for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants