Skip to content

Variation methods do not validate key presence #177

@baweaver

Description

@baweaver

Describe the bug

Variation methods do not validate that the key attribute is present in the provided user Hash:

ld_client.variation('flag_name', {}, 'default value')

...but this attribute is necessary to retrieve a live value, calling this with variation_detail will reveal that calls lacking the key attribute will not hit LaunchDarkly, and will instead provide the default value.

I believe this is a bug as it can cause subtle issues in users codebases without warning.

To reproduce

Call variation or variation_detail without a key attribute provided to the User hash.

Expected behavior

Warnings or errors on absence of key.

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