`updateConfigOnNewDatafile` does nothing
schmecs opened this issue · 2 comments
In OptimizelyManager
, the initialize
method states:
updateConfigOnNewDatafile – When a new datafile is fetched from the server in the background thread, the SDK will be updated with the new datafile immediately if this value is set to true. When it's set to false (default), the new datafile is cached and will be used when the SDK is started again.
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 setting updateConfigOnNewDatafile
to true
. 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?
@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!