Skip to content

Feature Flags: output of getAllVariants() method cannot be associated with a flag key #68

Closed

Description

@griswold

The getAllVariants() method currently returns List<SelectedVariant<Object>>.

SelectedVariant does not include any reference to the flag key for which it is a variant, so there is no way to associate the output of this method with a specific feature flag.

Mixpanel SDKs for other languages (e.g. python, node) address this by returning a dictionary that maps a flag key to variant information. So in this case, a method with a return type of Map<String, SelectedVariant<Object>> would be most consistent with other SDKs.

Activity

  1. tylerjroach commented on Apr 27, 2026

    @tylerjroach
    Contributor

    Thank you for the report. We are looking into it and will get back to you.

  2. tylerjroach commented on Apr 27, 2026

    @tylerjroach
    Contributor

    Hi @griswold Would it be sufficient to attach a getFlagKey() getter to SelectedVariant? This allows us to add the necessary flag key, without attempting a breaking change on the getAllVariants() return type.

  3. griswold commented on Apr 27, 2026

    @griswold
    Author

    Hi @tylerjroach , thank you so much for looking at this! Yes, any way of determining the flag key would solve the problem on my side.

  4. tylerjroach commented on Apr 29, 2026

    @tylerjroach
    Contributor

    getAllVariantsByFlag will go out in the next release! (1.8.1). I'll try to push it out tomorrow.

  5. tylerjroach commented on May 1, 2026

    @tylerjroach
    Contributor

    Hi @griswold, the change is live. Please reach out if you run into any more issues. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions