Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

Feature Flag evaluation not working as expected #52

@hect1c

Description

@hect1c

Hey,

I'm testing out Happykit Feature flags and ran into an issue or possibly I have a misunderstanding of how the feature flag evaluation works.

I have the following rules setup.

image

In my getServerSideProps I have the following code

    const { initialFlagState } = await getFlags({
      context,
      user: {
        // key: 'manager',
        key: '',
      },
    })

    console.log('initialFlagState', initialFlagState)

When I alternate between both key with manager and empty string it seems my feature flag key is always true. I'm assuming this is because my default when active is true is using variant 1 of true. But it says under Variant 1 option the following

This flag is currently active. It will respect individual user targeting and evaluate all rules. If none of these match, it will fall back to the value you configure here.

My understanding is that because of rule number 2 I set on the user where Key is not equal to the string I'm expecting then it will return variant 2 or false. Again this isn't working so not sure if I misunderstood how this should work, or I am doing something wrong.

Happy to create a reproduction if that helps but should be easy to replicate I think.

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