From 13657ba2dc328047d2ee1bb52d015a996c8e8d2d Mon Sep 17 00:00:00 2001 From: MajorTanya Date: Sun, 21 Dec 2025 10:04:02 +0100 Subject: [PATCH] Fix hard crash loop for unreachable servers It should be noted that this is a band-aid fix for deeper underlying issues. The code as-was would attempt a login on every init, including when apps like Mihon would recover from the first crash by going to their global crash handler activity. This usually happened whenever a user would be unable to connect to their Kavita instance (server not up, different/no networks, etc) and left the user unable to fix the issue by removing the broken API URL or uninstalling the extension through the app's menus. It doesn't matter if the Kavita instance that is unreachable is disabled in the extension settings, the crash will still occur because the login is performed in the init block, which is called regardless of an extension's specific enable/disable state (to be able to display settings, etc). --- .../src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt b/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt index 6469f011..137a5951 100644 --- a/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt +++ b/src/all/kavita/src/eu/kanade/tachiyomi/extension/all/kavita/Kavita.kt @@ -2587,10 +2587,8 @@ class Kavita(private val suffix: String = "") : ConfigurableSource, UnmeteredSou try { Log.d(LOG_TAG, "Starting Kavita extension initialization") - // First attempt login with timeout - val loginJob = async { doLogin() } try { - loginJob.await() + doLogin() } catch (e: Exception) { Log.e(LOG_TAG, "Login failed during initialization", e) initializationError = e