-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unable to get back a response from the backend where the feature is explicitly disabled #72
Comments
Hi @StylianosGakis, thanks for raising this issue. I believe this is working as intended as the You can refer to: https://docs.getunleash.io/using-unleash/troubleshooting/flag-not-returned Can you expand a bit on your use case and why you would want to see the disabled feature flag being returned? |
I want a feature to be true by default, so failing to fetch the flag still results in the feature being enabled. And then I want to explicitly disable it for a specific set of people. So those specific people get the flag as false, and the feature is hidden for them. |
Hi @StylianosGakis, I believe what you're looking for is a kill switch instead. That way your feature is enabled by default, but if you switch the toggle to enabled, it disables the feature. Basically what this means is:
I hope this helps! |
Right, we do use a kill switch for another thing, and that has worked well for us, so that is great. What I wonder then is if I want to gradually work on a feature, for some releases I have it off by default (for the offline case, really important to note this), and I turn it on conditionally, as normal flags work, all is good here. Is the verdict here that basically I can't reuse the same flag and I should introduce a new flag for that use case? Then for version X.X.X and lower I must remember that we use flag nbr1 and and for versions over X.X.X we use flag nbr2. And make sure that as I make that new release I stop checking the old flag and start using the new kill switch? Am I understanding this right? |
@StylianosGakis There's one more option where you can use strategy variants (https://docs.getunleash.io/reference/strategy-variants). Here's one example (https://app.unleash-hosted.com/demo/projects/ipstrategies/features/always-enabled): Users of semver 4.5.1 get enabled variant and the remaining users get % split. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I got a feature flag, which makes sense to have it be default as
true
, so I fetch it withclient.isEnabled("feature_id", defaultValue = true)
.Now my problem is that I want the feature flag to come back from the backend explicitly as
enabled = false
when the feature flag is enabled, but I am not eligible for it due to one of my constraints.What I experience instead is that when the flag is disabled in the unleash web client that I simply do not receive this flag at all.
I've confirmed this by using the in-memory cache for the flags and doing
As a hack to read into the entire cache, and when the feature is on, I get in there something like
Toggle(name=feature_id, enabled=true, variant=Variant(name=disabled, enabled=false, payload=null))
When I go to the unleash client and I set the rollout to 0% for example, as an easy one to test, what I see is that it's simply not there.
I may be missing something, but how would I be able to get back "Toggle(name=feature_id, enabled=false, variant=Variant(name=disabled, enabled=false, payload=null))" (emphasis on the bold false there) here instead?
Unleash version
5.9.0+main.3426.a4cd0771 (Pro)
Subscription type
Pro
Hosting type
Hosted by Unleash
SDK information (language and version)
0.5.7
The text was updated successfully, but these errors were encountered: