-
Notifications
You must be signed in to change notification settings - Fork 41
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
Empty userId breaks gradual rollout 100% expected behavior. #215
Comments
If that's a real issue, I'm ready to open a PR, thanks :) |
Hey @karimkod, Thanks for reporting this! Yes, this appears to be a bug. Empty string should not be doing this! Oh if you're willing to submit a PR that would be amazing! |
@sighphyre here it is #216 |
Describe the bug
When passing an empty userId (string.Empty) the toggle is not enabled. Although the toggle have a gradual rollout strategy of 100%.
When passing a null or a non-empty value, the same toogle is enabled as expected.
To Reproduce
Steps to reproduce the behavior:
Create a toggle with a gradual rollout strategy.
Pass the userId as string.empty ("") :
Expected behavior
The value of unleashedEnabled should be always true, since the gradual rollout is 100% and there is not constraints.
Screenshots
If applicable, add screenshots to help explain your problem.
**Version **
Additional context
Did my own digging and I think that the source is the calculation of
stickinessId
https://github.com/Unleash/unleash-client-dotnet/blob/main/src/Unleash/Strategies/FlexibleRolloutStrategy.cs#L43When userId is empty, it is returned as the first choice of stickinessId but then we do the
if (!string.IsNullOrEmpty(stickinessId))
which will be false, always.The text was updated successfully, but these errors were encountered: