The hidden WebView built in MainActivity#printText (app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt around line 1279) drives the print flow by setting a WebViewClient that overrides shouldOverrideUrlLoading and onPageFinished. The onPageFinished callback is what actually starts the print job via createWebPrintJob.
The same WebViewClient does not override onReceivedError. So if loadData fails (for example on a very large note that exceeds WebView limits, or under a transient renderer process error) the result is:
onPageFinished never fires, so createWebPrintJob is never called and no print dialog appears.
onReceivedError is not handled either, so the user gets no toast, no log line, no error.
The user taps "Print", nothing happens, and there is no feedback at all.
Suggested fix: add onReceivedError(view, request, error) on the same anonymous WebViewClient, guard with request.isForMainFrame so any sub-resource failure does not trigger the error path twice, and surface the failure to the user. The codebase already has a translated R.string.unknown_error_occurred in org.fossify.commons, which is what printText already uses elsewhere in this activity via showErrorToast. PR for this at #365.
The hidden
WebViewbuilt inMainActivity#printText(app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt around line 1279) drives the print flow by setting aWebViewClientthat overridesshouldOverrideUrlLoadingandonPageFinished. TheonPageFinishedcallback is what actually starts the print job viacreateWebPrintJob.The same WebViewClient does not override
onReceivedError. So ifloadDatafails (for example on a very large note that exceeds WebView limits, or under a transient renderer process error) the result is:onPageFinishednever fires, socreateWebPrintJobis never called and no print dialog appears.onReceivedErroris not handled either, so the user gets no toast, no log line, no error.The user taps "Print", nothing happens, and there is no feedback at all.
Suggested fix: add
onReceivedError(view, request, error)on the same anonymous WebViewClient, guard withrequest.isForMainFrameso any sub-resource failure does not trigger the error path twice, and surface the failure to the user. The codebase already has a translatedR.string.unknown_error_occurredinorg.fossify.commons, which is whatprintTextalready uses elsewhere in this activity viashowErrorToast. PR for this at #365.