-
Notifications
You must be signed in to change notification settings - Fork 73
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
FakeUnleash doesn't take into account global activation/deactivation for certain isEnabled method #239
Labels
Comments
Oh that's a nice catch, this probably isn't something we'll tackle immediately but we'd be more than happy to take a PR |
This is an oversight on our end. Your suggestion makes sense at first sight, feel free to push a PR! Thanks 👍🏼 |
chriswk
added a commit
that referenced
this issue
May 8, 2024
As discussed in #239 - When all is enabled, we had a bit of a surprising behaviour where we'd fallback to fallback action for `isEnabled(featureName, fallback)` even if all was enabled and feature did not exist. This PR fixes that, and adds tests to confirm this behaviour is intentional. closes: #239
chriswk
added a commit
that referenced
this issue
May 8, 2024
As discussed in #239 - When all is enabled, we had a bit of a surprising behaviour where we'd fallback to fallback action for `isEnabled(featureName, fallback)` even if all was enabled and feature did not exist. This PR fixes that, and adds tests to confirm this behaviour is intentional. closes: #239
chriswk
added a commit
that referenced
this issue
May 14, 2024
As discussed in #239 - When all is enabled, we had a bit of a surprising behaviour where we'd fallback to fallback action for `isEnabled(featureName, fallback)` even if all was enabled and feature did not exist. This PR fixes that, and adds tests to confirm this behaviour is intentional. closes: #239
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The FakeUnleash method using the fallbackAction doesn't take into account the global activation/deactivation flags.
Right now the code at
unleash-client-java/src/main/java/io/getunleash/FakeUnleash.java
Lines 39 to 45 in b2ac9ae
just checks whether a certain flag is configured. But if you use the global flags, then no specific feature is set. Therefore this method always falls back to the default action instead, which is unexpected.
Therefore I would suggest to change the line of
unleash-client-java/src/main/java/io/getunleash/FakeUnleash.java
Line 41 in b2ac9ae
Steps to reproduce the bug
enableAll
isEnabled("abc", (a, b) -> false)
false
even though all flags have been enabled.Expected behavior
FakeUnleash should correctly take into account global flags.
Logs, error output, etc.
No response
Screenshots
No response
Additional context
No response
Unleash version
9.2.0
Subscription type
None
Hosting type
None
SDK information (language and version)
No response
The text was updated successfully, but these errors were encountered: