mixpanel/mixpanel-iphone

Tweak values not falling back to cached values

alexrdclement opened this issue · 1 comments

Integration Method: CocoaPods

Xcode Version: 12.0

Library Version: 3.6.2

Platform: iOS

Language: Objective-C

Description:
I have an A/B test with a boolean value. Even when the experiment value is set “true”, the experiment has no variants, and the user is enrolled in the experiment, I’ve occasionally seen the value flip back to “false”. I’ve determined this is the tweak value falling back to its default value of “false” — perhaps due to a failed network call — instead of falling back to a cached value, as stated in the docs here: https://developer.mixpanel.com/docs/ios#notes-on-experiment-delivery

We’re checking the MPTweakValue in the callback of joinExperimentsWithCallback like this:

[Mixpanel.sharedInstance joinExperimentsWithCallback:^{
    BOOL tweakValue = MPTweakValue(@"Test experiment", NO);
    NSLog(@"Tweak value: %d", tweakValue);
}];

Steps to reproduce:

  • Set up a tweak value in the app with the code above
  • In Mixpanel, create an experiment that sets the tweak value to “true”. Ensure your device is enrolled in the experiment.
  • Wait a bit, restart the app, should print “Tweak value: true”
  • Kill the app
  • Disable WiFi or enable Network Link Conditioner
  • Restart the app

This prints “Tweak value: false”.

Expected Behavior:
Fall back to the last successfully retrieved value, “true”.

As a workaround, we’ve set up our MPTweakValues with defaults that cannot be confused with legitimate experiment values (e.g. “unknown” where “true” and “false” are the legitimate values) and ignore the default value when it’s reported.

Mixpanel is deprecating Messaging and Mobile A/B testing features(more details), please contact our support if you need to continue the conversation for any critical issues. Sorry for the inconvenience.