From 77a9cef3a1cf4aa5daf71e09687530d21da1988f Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 16 Oct 2026 14:44:39 +0600 Subject: [PATCH] fix(stream-proxy): improve logging for cache timeout and handle disconnection scenarios --- .../kotlin/dev/krtirtho/spotube/core/server/StreamProxy.kt | 5 ++++- .../dev/krtirtho/spotube/modules/lyrics/LyricsScreen.kt | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/server/StreamProxy.kt b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/server/StreamProxy.kt index 607091ee..cb52ae66 100644 --- a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/server/StreamProxy.kt +++ b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/core/server/StreamProxy.kt @@ -131,8 +131,11 @@ internal class StreamProxy( } return } + // The caching request ended without committing (player disconnected or the + // source was switched); nothing left to wait for. + if (streamingMutex.withLock { trackId !in streamingInProgress }) break } - logger.w { "Timeout waiting for cache of track $trackId, falling through to upstream" } + logger.d { "No cache for track $trackId after waiting, falling through to upstream" } } try { diff --git a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/lyrics/LyricsScreen.kt b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/lyrics/LyricsScreen.kt index 24285b5b..22e74fbf 100644 --- a/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/lyrics/LyricsScreen.kt +++ b/composeApp/src/commonMain/kotlin/dev/krtirtho/spotube/modules/lyrics/LyricsScreen.kt @@ -56,11 +56,8 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import compose.icons.FeatherIcons -import compose.icons.feathericons.X import dev.krtirtho.plugin_interfaces.plugin_apis.lyrics.LyricsLine import dev.krtirtho.spotube.core.ui.component.ApplicationBackButton -import dev.krtirtho.spotube.modules.shell.LocalAppShellBottomInset import dev.krtirtho.spotube.resources.iconsax.Iconsax import dev.krtirtho.spotube.resources.iconsax.IconsaxArrowDown4 import kotlinx.coroutines.launch @@ -129,7 +126,6 @@ fun LyricsScreen( .weight(1f) .fillMaxWidth() .padding(horizontal = 16.dp) - .padding(bottom = LocalAppShellBottomInset.current + 24.dp) ) { Spacer(modifier = Modifier.height(16.dp)) when {