Skip to content

feat(api): Decision Notification Listener for IsFeatureEnabled and GetEnabledFeatures APIs. #149

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

Merged
merged 8 commits into from
Apr 9, 2019

Conversation

mfahadahmed
Copy link
Contributor

Summary

  • Implemented Decision Notification Listener for IsFeatureEnabled and GetEnabledFeatures APIs.

Test plan

  • Added unit tests.

@mfahadahmed mfahadahmed changed the title Decision Notification Listener for IsFeatureEnabled and GetEnabledFeatures APIs. feat(api): Decision Notification Listener for IsFeatureEnabled and GetEnabledFeatures APIs. Mar 25, 2019
@mfahadahmed mfahadahmed requested a review from a team April 2, 2019 14:16
…ener-feature-enabled

# Conflicts:
#	OptimizelySDK.Tests/ProjectConfigTest.cs
#	OptimizelySDK.Tests/TestData.json
Copy link

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

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

Minor feedback. Looks good otherwise.

@@ -645,5 +669,10 @@ private bool ValidateStringInputs(Dictionary<string, string> inputs)

return isValid;
}

private bool IsValidDecision(FeatureDecision decision)

Choose a reason for hiding this comment

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

What is this validity check about? Also, I feel it belongs on the FeatureDecision class and not like this.

Choose a reason for hiding this comment

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

Perhaps call it IsExperimentDecision?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check validates decision object. But I misunderstood that DecisionService.GetVariationForFeature() can return null.

I removed this function as the above method can't return null and checking decision.Variation is enough for validating decision object.

Copy link

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

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

Please resolve conflicts.

Copy link

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

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

LGTM

@aliabbasrizvi aliabbasrizvi merged commit 4117938 into master Apr 9, 2019
@aliabbasrizvi aliabbasrizvi deleted the fahad/decision-listener-feature-enabled branch April 9, 2019 00:43
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.

3 participants