Closed schmecs closed 2 years ago
@schmecs Correct, the flag is used in the override method of DefaultDatafileHandler. DefaultDatafileHandler is used when you do not provide a custom one, so it's not required to add the default one. If you enable periodic datafile updates (.withDatafileDownloadInterval(TimeUnit.MINUTES.toSeconds(15)), that can be another source of enabling the flag automatically.
Ah -- that explains it. We're using .withDatafileDownloadInterval
which must be enabling immediate application. Thanks for the quick explanation!
https://github.com/optimizely/android-sdk/blob/f11ed5bfc59d23ed3a9745603076de79fa4a12a8/datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/DatafileHandler.java#L55
In
OptimizelyManager
, theinitialize
method states:As you can see in the
DatafileHandler
method, that boolean actually appears to be unused. I've confirmed through testing that the default is to apply the config immediately. This is actually the behavior we want in our app, but we are not settingupdateConfigOnNewDatafile
totrue
. It seems like it's not currently possible to delay application of a new datafile until the next session.Edit: I see that this flag is used appropriately in
DefaultDatafileHandler
, but I can confirm that when we initialize without setting it, the updated config is applied immediately, so it seems like this default is not automatically applied. It appears we might need to add.withDatafileHandler(DefaultDatafileHandler())
to our initialize call. Does that sound right?