How does stickiness work when scaling down, instead of up? #6889
-
Unleash allows that when scaling up a feature in a gradual rollout, the same users or entities will keep the same experience. https://docs.getunleash.io/reference/stickiness E.g., if you're in the first 10% who received the feature, you'll also still have the feature enabled when the rollout is increased to 20%. (1) Does stickiness apply in the reverse direction? I.e., if you received the feature after it rolled out to 100%, you'll continue to receive the feature even after the percentage decreases all the way to 0%, which will only apply to new user IDs or entity IDs not yet seen by Unleash. (2) If the answer to the above is no, then is there an option to get this functionality? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @steffly, great question! It will be sticky in the reverse direction. The way it works is using a hash function that turns the field into a number from 1 to 100 in a consistent way: https://docs.getunleash.io/reference/stickiness#consistency that way whenever you change the rollout percentage (say from 50% to 30%), the hash value a user receives won't change. If for example Unleash associated the value 27 to a user, it will always be 27 (always considering the field on which the feature is sticky on does not change for that user). So when you do 30% rollout the user will see the feature, also when you roll up to 50%. If you roll down to 29% it will still see the feature, while if you roll down to 26% it will stop seeing the feature. This value is not something you can easily calculate to tell whether user X will see feature Y when rolling up to 30%, but you should be able to use the playground to test this. Because the hash is the same, it should yield the same result. I hope that covers your question! If you're curious and want to test this out, I've created this small gist: https://gist.github.com/gastonfournier/c20a1b57df3af69c7590c37c0dd2a037 |
Beta Was this translation helpful? Give feedback.
-
@gastonfournier Hello, I think I didn't explain well enough. Our requirement is this: Once a use has seen a feature, they should always see the feature in the future, even when the % goes down, and once a user has not seen a feature, they should always not see the feature in the future, even when the % goes up. (That's what I thought "stickiness" meant but maybe not?) |
Beta Was this translation helpful? Give feedback.
Hey @steffly, sorry for the delay. I came back from vacations and forgot to check this.
TL;DR; that's not how feature flags work and I don't think that's a feature we'd consider for Unleash. But there are options.
If I understood correctly, the expectation is that if a feature was initially flawed, it should continue to be flawed for the users already exposed to it. And the problem is that the purpose of feature flags, is to allow you to disable a feature if it's found to be flawed. Modifying this fundamental behavior is not something we'd consider.
You still have a few options, if this is what your use case requires: