Skip to content

Conversation

@amerjusupovic
Copy link
Contributor

No description provided.

// Always on
keyValues.Add(new KeyValuePair<string, string>(featureFlagPath, true.ToString()));
// Add the AlwaysOn filter instead of setting the flag to "true" so feature management doesn't skip evaluating variants and telemetry when present
if (featureFlag.Variants != null || featureFlag.Telemetry != null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to mention that this condition could be removed so that we just always send AlwaysOn instead of setting the flag to true. It simplifies the logic and would better handle any future additions to the feature definition, but it would basically remove the optimization in the feature management library to skip evaluating the rest of the flag if it's set to true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer removing the optimization for simplicity / if we add more fields in the future, we don't have to update this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on simplicity.

{
keyValues.Add(new KeyValuePair<string, string>($"{FeatureManagementConstants.SectionName}:{featureFlag.Id}", false.ToString()));
// Only explicitly set the flag to false if there are no variants to override the enabled state
if (featureFlag.Variants == null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would need the same "Variants == null" && "Telemetry == null" logic as above.

But more importantly, I think we just remove this shortcut as well. Old FM will see no Filters and treat it as false, New FM will respect the status of Disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I agree with removing it now too

@amerjusupovic amerjusupovic merged commit 60695b7 into preview Feb 28, 2024
@amerjusupovic amerjusupovic deleted the ajusupovic/add-featurestatus branch February 28, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants