Skip to content
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

Groups don't intersect? #71

Closed
pjaspers opened this issue May 28, 2015 · 5 comments
Closed

Groups don't intersect? #71

pjaspers opened this issue May 28, 2015 · 5 comments

Comments

@pjaspers
Copy link

If an actor belongs to two groups, once it's enabled for one group it's automatically enabled for that user even if the second group defines it as disabled.

This might be the desired output, but it felt counterintuitive to me.

# Contrived example, but bear with me.
Flipper.register(:large_group) do |actor|
  actor.part_of_large_group?
end

Flipper.register(:subset_of_large_group) do |actor|
  actor.part_of_small_group? 
end

$flipper[:can_do].enable_group :large_group
$flipper[:can_do].disable_group :subset_of_large_group

$flipper[:can_do].enabled? user_in_subset # => true

Is this the desired behavior?

@jnunemaker
Copy link
Collaborator

This might be the desired output, but it felt counterintuitive to me.

This is the desired behavior. Flipper is made to be enabled as soon as any of the gates return true. I can see how you could have expected the opposite. Maybe disable group isn't quite named correctly. The goal of disable is simply to clear the enable. If whatever it is has not been enabled, then it effectively does nothing. Does that make sense? Perhaps I should mention this in the readme or something.

@pjaspers
Copy link
Author

That makes sense. Wording is indeed a bit weird.

@jnunemaker
Copy link
Collaborator

Out of curiousity, are you using flipper in production? Anything you can share about how you are using it? Using a core adapter or a custom one? Its ok if you don't want to answer, I just like to ask people to help get a sense of how people are using flipper.

@jnunemaker
Copy link
Collaborator

Add a caveats markdown file: https://github.com/jnunemaker/flipper/blob/master/docs/Caveats.md. Hopefully that can serve as an aid to this type of question in the future.

@pjaspers
Copy link
Author

Great!

We're starting to use it in production, with the redis adapter. For now using it with just two groups and a couple of features.

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

No branches or pull requests

2 participants