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

Library does not properly handle feature flags with no % rollout #24

Closed
paolodamico opened this issue Feb 16, 2021 · 2 comments · Fixed by #30
Closed

Library does not properly handle feature flags with no % rollout #24

paolodamico opened this issue Feb 16, 2021 · 2 comments · Fixed by #30
Assignees

Comments

@paolodamico
Copy link
Contributor

See sentry issue https://sentry.io/organizations/posthog/issues/2220836956/?project=1899813. If a feature flag is enabled for everyone without a % rollout, the client crashes. Notice that this is different from a 100% rollout which works fine.

unsupported operand type(s) for /: 'NoneType' and 'int'

posthoganalytics/client.py#L276

response = _hash(key, distinct_id) <= (feature_flag['rollout_percentage'] / 100)
@timgl
Copy link
Contributor

timgl commented Feb 16, 2021

I think we should also fix this on the posthog side, to always return 100 if rollout_percentage is not set

@macobo
Copy link
Contributor

macobo commented Feb 18, 2021

I think this is a bug in the API which I may have introduced with the groups change.

Specifically, the api needs to return is_simple_flag True and rollout_percentage null for this.

I haven't been able to repro this - how did you set up the flag?

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

Successfully merging a pull request may close this issue.

4 participants