https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
d

dazzling-answer-34446

01/31/2024, 11:34 AM
Hi folks, Started a new experiment yesterday with three variants: 1. Control 2. VariantA 3. VariantB Control and VariantA were set to 50%, and VariantB set to 0%. However, it looks like VariantB is being served to users - any idea what's going on? 🤔
f

fresh-football-47124

01/31/2024, 1:58 PM
That looks like a bug somewhere
what does your implementation look like?
Did you change the assignment after running the experiment?
d

dazzling-answer-34446

01/31/2024, 2:05 PM
No changes to assignment when we started the experiment. We just set it up with three variants serving different strings 🤔
f

fresh-football-47124

01/31/2024, 5:54 PM
I mean, what does the SDK code look like?
d

dazzling-answer-34446

02/01/2024, 12:31 PM
Copy code
enum class TestVariant {
        VARIANT_A,
        VARIANT_B,
        VARIANT_C,
        CONTROL;

        override fun toString(): String {
            return when (this) {
                VARIANT_A -> "VariantA"
                VARIANT_B -> "VariantB"
                VARIANT_C -> "VariantC"
                CONTROL -> "Baseline"
            }
        }
    }

private fun gbTestVariant(value: String?): TestVariant {
        val variant: TestVariant = when (value) {
            "VariantA" -> TestVariant.VARIANT_A
            "VariantB" -> TestVariant.VARIANT_B
            "VariantC" -> TestVariant.VARIANT_C
            else -> TestVariant.CONTROL
        }
        return variant
    }

val featureVariant: TestVariant by lazy { gbTestVariant(growthbook.feature(IS_FEATURE_ENABLED).value as? String)}
We are simply grabbing the variant that is being served up
c

clever-rose-53406

02/05/2024, 12:08 PM
@fresh-football-47124 Do you have any insights on this issue?
4 Views