FirebaseAuth Java SDK - Hanging in GlobalScope.launch(Dispatchers.Main) #661
-
I am using the firebase-kotlin-sdk (2.1.0) in my JVM API code and it uses the firebase-java-sdk for FirebaseAuth. If relevant, specify:
The section failing in their FirebaseAuth class:
I am not sure if it's down to a Kobweb configuration issue on my side or just that their SDK shouldn't be using GlobalScope with Dispatchers.Main. I have tried updating to kotlinx-coroutines-core-jvm 1.10.1. I have raised issues in firebase-kotlin-sdk and firebase-java-sdk (the main issue). Any ideas welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I have no idea why they're using How did you confirm their code was hanging? Printing console output before and after you set it? Meanwhile you should also test that Otherwise, looks like they're just setting and triggering listeners. The only things I can imagine might block are the firebase platform calls or some bad blocking listener. |
Beta Was this translation helpful? Give feedback.
-
I have been debugging using Kobweb JVM debugging in IntelliJ, so I could set breakpoints and step through their code... well and not when it hangs ;) |
Beta Was this translation helpful? Give feedback.
-
The fix might be simple. Add a dependency on Even if you're not using Swing yourself -- it is a UI framework after all -- JVMs all include it as part of the package, and they provide useful scheduling functionality that coroutines take advantage of here. For me, this looks like:
kotlinx-coroutines = "1.10.1"
[libraries]
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
[bundles]
kotlinx-coroutines = ["kotlinx-coroutines-core", "kotlinx-coroutines-swing"]
jvmMain.dependencies {
implementation(libs.bundles.kotlinx.coroutines)
} |
Beta Was this translation helpful? Give feedback.
The fix might be simple. Add a dependency on
org.jetbrains.kotlinx:kotlinx-coroutines-swing
and tell me if that solves it for you.Even if you're not using Swing yourself -- it is a UI framework after all -- JVMs all include it as part of the package, and they provide useful scheduling functionality that coroutines take advantage of here.
For me, this looks like:
gradle/libs.versions.toml