-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Is this a support request?
Shouldn't be, but I think this is either a bug or some documentation should be changed.
Describe the bug
Immediately after LDClient.init(a, conf, cont, 14) returns, I expect LDClient.isInitialized to return true, but it does not do so for a nontrivial amount of time, especially since I specified a nonzero timeout.
To reproduce
Timber.e("start: ${System.currentTimeMillis()}")
val client: LDClient = LDClient.init(application, ldConfig, context, 14)
Timber.e("before: ${System.currentTimeMillis()}")
Timber.e("init: ${client.isInitialized}")
while(!client.isInitialized) {}
Timber.e("after: ${System.currentTimeMillis()}")
Timber.e("client init: ${client.isInitialized}")Expected behavior
I expect LDClient.isInitialized to return true immediately after LDClient.init() is called with a nonzero timeout.
Logs
2024-12-17 13:08:22.140 E start: 1734458902140
2024-12-17 13:08:22.142 E before: 1734458902141
2024-12-17 13:08:22.142 E client init: false
2024-12-17 13:08:22.441 E after: 1734458902440
2024-12-17 13:08:22.442 E client init: true
SDK version
5.5.0
Language version, developer tools
I think the only relevant information is Java 21 and Gradle 8.9. This was tested on the Android sample app.
OS/platform
Android 11
Additional context
If this isn't actually a bug, then I'd like to request some documentation updates because it's easy to confuse the fact that isInitialized shouldn't be true after init() finishes. I can imagine a scenario where passing 0 for the wait would cause this situation to happen, but I've indicated that I am willing to wait for init().