Skip to content

Mixpanel integration: falsy variant values collapse into enabled-state #7701

@Zaimwa9

Description

@Zaimwa9

How are you running Flagsmith

  • Self Hosted with Docker
  • Self Hosted with Kubernetes
  • SaaS at flagsmith.com
  • Some other way (add details in description below)

Describe the bug

When a flag is enabled and the variant value is falsy, the mixpanel integration incorrectly fallbacks the value to the flag state true instead of false.

The documentation is ambiguous, only stating if the flag has no remote config value, pass the boolean state

# Current mapping

  Flag state | Variant value              | Sent to Mixpanel
  -----------+----------------------------+----------------------
  ON         | True                       | true (value)
  ON         | False / None / 0 / ""      | true (enabled state)
  ON         | "hello" / 42               | the value
  OFF        | anything                   | false (enabled state)

Steps To Reproduce

  1. Activate Mixpanel integration in your environment
  2. Create a multivariate feature
  3. Enable the flag
  4. Set a variant value to be false
  5. Mixpanel will show the variant as true

Expected behavior

The mapping should be:

  Flag state | Variant value              | Sent to Mixpanel
  -----------+----------------------------+----------------------
  ON         | True                       | true (value)
  ON         | False / "" / 0             | false
  ON         | None / null                | true (enabled state)
  ON         | "hello" / 42               | the value
  OFF        | anything                   | false (enabled state)

The resolution of the issue includes:

  • Updating the doc to be exhaustive in relation to the behavior
  • Communicate with impacted customers before releasing

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions