Skip to content

JS node SDK: isFeatureEnabled returning false even if the feature is enabled #756

@ghost

Description

What I wanted to do

Ask if feature A is enabled when using attributes with undefined value

What I expected to happen

To get True if feature A is enabled

What actually happened

I am getting False event though feature is enabled

Steps to reproduce

  • create feature A with key feature_a
  • enabled feature A for everybody
  • call following method from JS node sdk:
Optimizely?.isFeatureEnabled('feature_a', 'test', { deviceOs: undefined})

You will get false... This is because if the attribute has undefined then you just stop evaluating the feature for some reason and you return false...
Imho we should not return false and continue evaluation of feature flag OR at least document this behaviour and update the TS types for that function

"@optimizely/optimizely-sdk": "4.9.1",
node version: v16.13.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions