Skip to content

WebxdcStoreActivity does not log WebView main-frame load failures #153

@jim-daf

Description

@jim-daf

WebxdcStoreActivity (src/main/java/org/thoughtcrime/securesms/WebxdcStoreActivity.java) loads a remote store URL via webView.loadUrl(Prefs.getWebxdcStoreUrl(this)). The current WebViewClient overrides shouldOverrideUrlLoading and shouldInterceptRequest, but not onReceivedError.

interceptRequest already catches RPC failures and synthesises a plain-text "Could not load apps. Are you online?" response, which covers the common offline case nicely. But that only kicks in once shouldInterceptRequest is actually invoked. WebView-layer failures that prevent shouldInterceptRequest from running (URL resolution errors, premature transport reset on the very first main-frame request, renderer crashes) end up silent in adb logcat, which makes triage of store load issues harder than it has to be.

Suggested fix: add onReceivedError(view, request, error) on the same anonymous WebViewClient (API 23+), guard with request.isForMainFrame() so transient sub-resource errors do not spam the log, and log the error code and description via the existing Log helper and TAG. PR for this at #154.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions