Skip to content

Stream WebViewClients have no onReceivedError, so playback failures leave nothing in the log #1133

Description

@jim-daf

The two stream-overlay WebView clients in ui/main/stream/ only override shouldOverrideUrlLoading (and onPageFinished in the Compose one). There is no onReceivedError override on either, so when the Twitch player URL fails to load (network down, blocked DNS, the embed endpoint moved, etc.) the WebView just falls silent and the overlay stays blank with nothing in the log to point at.

StreamWebView.kt:29:

private class StreamWebViewClient : WebViewClient() {
    @Deprecated("Deprecated in Java")
    override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { ... }
    override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean { ... }
}

StreamView.kt:235:

private class StreamComposeWebViewClient(
    private val onPageFinished: () -> Unit,
) : WebViewClient() {
    override fun onPageFinished(view: WebView?, url: String?) { ... }
    @Deprecated("Deprecated in Java")
    override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean { ... }
    override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean { ... }
}

Suggested fix

Add an onReceivedError override on both clients that logs the failing URL + description through the existing KotlinLogging.logger(...) already used elsewhere in the project (e.g. EmoteDiskCache). Gate on request.isForMainFrame so blocked sub-resources do not spam the log on every embed.

A PR with that change is open at #1134.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions