K9WebViewClient: log WebView main-frame load errors#11030
Merged
wmontwe merged 2 commits intoMay 26, 2026
Conversation
K9WebViewClient is the WebViewClient used to render email message bodies in the legacy message view. It currently overrides shouldOverrideUrlLoading and shouldInterceptRequest, but not onReceivedError. When the WebView fails to load the main frame, the failure is swallowed and the user is left with a blank message body. The error reason is not in the device log either, which makes triage difficult. Add the API 23+ onReceivedError override, scoped to request.isForMainFrame so that occasional sub-resource errors (broken inline images, blocked http content in https mails, etc.) do not flood the log. minSdk for the legacy module is 23, so the deprecated pre-M overload is intentionally not added. No behaviour change for successful loads; on failure, the error code, description, and failing URL are recorded via the legacy Log helper that is already used elsewhere in this file.
Contributor
|
✅ Validation Passed: All report and feature-flag labels are correctly set. |
Member
|
@jim-daf There is a warning about too many methods, this could safely be ignored for this class by adding |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11029.
K9WebViewClientalready overridesshouldOverrideUrlLoading,shouldInterceptRequestandonPageFinished. It does not overrideonReceivedError, so any failure while loading a message body in the legacy message view is silent: the user sees a blank message body, and nothing useful gets recorded in adb logcat.This PR adds the API 23+ overload only, since
minSdkfor the legacy module is 23 (build-plugin/src/main/kotlin/ThunderbirdProjectConfig.kt: const val sdkMin = 23), so the deprecated pre-M overload is not reachable on any device the app ships to.Notes on scope:
http://resources inside anhttps://mail) and would just spam the log without giving useful information about the root render failure.Log.dvianet.thunderbird.core.logging.legacy.Log, matching the existing imports and call style in this file (see the existingLog.d(e, "Couldn't open URL: %s", uri)on the same class).Out of scope but mentioned in the issue:
QuotedMessageMvpViewhas the same gap. Happy to send a follow-up PR if maintainers prefer that one bundled, butK9WebViewClientis the dominant codepath and felt like the right place to start.