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

[BUG] all_flags method returning the wrong value. #53

Closed

Description

@lpoulter

If a flag's rollout is set to <100% but the user is given in the Include section of the web application.

variation returns true,
all_flags shows the flag as false for the user.

Is this expected behaviour?
I would expect both methods to hold the same value for the flag.

Activity

  1. changed the title [-]all_flags method returning the wrong value.[/-] [+][BUG] all_flags method returning the wrong value.[/+] on Mar 8, 2017
  2. drichelson commented on Mar 8, 2017

    @drichelson
    Contributor

    Hi @lpoulter thanks for reaching out. Will you please email support@launchdarkly.com and we can help you out from there?

  3. adamlaunchingdarkly commented on Mar 9, 2017

    @adamlaunchingdarkly
    Contributor

    Just for reference, this issue can be successfully reproduced with the following:

    An int-type key value passed to all_flags fails to properly evaluate when used before variation.

    var LaunchDarkly = require('ldclient-node');
    
    var ld_client = LaunchDarkly.init("YOUR_SDK_KEY")
    
    ld_client.once('ready', function() {
    
    var user_with_key_type_int = {"key" : 123};
    console.log("INT: "+JSON.stringify(user_with_key_type_int));
    
    var user_with_key_type_string = {"key" : "123"};
    console.log("STRING: "+JSON.stringify(user_with_key_type_string));
    console.log("===")
    console.log("INT all_flags")
    ld_client.all_flags(user_with_key_type_int, function(err, flags) {
    console.log(flags);
    });
    
    console.log("===")
    console.log("STRING all_flags")
    ld_client.all_flags(user_with_key_type_string, function(err, flags) {
    console.log(flags);
    });
    
    console.log("===")
    console.log("INT variation")
      ld_client.toggle("variation-test", user_with_key_type_int, false, function(err, show_feature) {
        if (show_feature) {
            console.log("TRUE");
        }
        else {
            console.log("FALSE");
        }
    
      });
    
    console.log("===")
    console.log("STRING variation");
      ld_client.toggle("variation-test", user_with_key_type_string, false, function(err, show_feature) {
        if (show_feature) {
            console.log("TRUE");
        }
        else {
            console.log("FALSE");
        }
    
      });
    
    console.log("===")
    console.log("INT all_flags after variation")
    ld_client.all_flags(user_with_key_type_int, function(err, flags) {
    console.log(flags);
    });
    
    console.log("===")
    console.log("STRING all_flags after variation")
    ld_client.all_flags(user_with_key_type_string, function(err, flags) {
    console.log(flags);
    });
    
    });
    
  4. jkodumal commented on Mar 10, 2017

    @jkodumal
    Contributor

    This is fixed in 3.0.8. Thanks for the report!

  5. added a commit that references this issue on Feb 13, 2018
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