Allow recovery if printer capabilities fetch fails |
|||
Issue descriptionWhen print preview fails to retrieve printer capabilities from a device, the dialog fails and cannot be recovered. We should mitigate this failure and allow users to pick a working printer without closing the dialog. This problem is rare as it requires an invalid PPD or an error in the print server. It does not need to be addressed immediately.
,
Apr 25 2017
skau: Are you going to look at this? Want to flip this to assigned?
,
Apr 26 2017
I don't have time to look at it right now.
,
Apr 27 2017
What do you mean by capabilities fetch failing? I experimented with this on a local build on Linux and tried a couple different things: (1) forcing GetCapabilitiesOnBlockingPoolThread to return a nullptr, which triggered the capabilities fetch failure event. I could still access the "Change" button to change the destination as well as the cancel button to close the dialog. I do think it would be good to display an error message here to let the user know they should select a different destination. The preview is stuck at "Loading" and none of the options appear so it is clear something is wrong, but not what exactly the problem is or how to fix it. (2) Also tried forcing GetPrinterSemanticCapsAndDefaults to return false, which would result in a successful GetCapabilities call but an empty dictionary of printer capabilities. This also worked fine - actually printed successfully with this. It just won't necessarily populate all the preview dialog fields that are supported since it cannot see that those capabilities exist.
,
Apr 27 2017
GetCapabilitiesOnBlockingPoolThread returning nullptr is the most obvious way to make it fail. If I remember correctly, there's an error variable somewhere in the renderer that prevents printing or loading of any attributes after this stage. The bug is in the javascript somewhere but I don't remember exactly where.
,
Apr 27 2017
I think the unrecoverable error occurs when we have an invalid settings error from the native layer (which is usually due to something being incorrect about the printer setup), not when capabilities fetch fails entirely. This gets triggered by the PrintHostMsg_PrintPreviewInvalidPrinterSettings message sent from print web view helper. The Print Preview UI state gets set to ERROR and then never escapes. When I tested this, it was still possible to change printers and settings and the preview updated, but as soon as I tried to print something it froze because we hit a check in the javascript. Does that sound like what you were running into?
,
Apr 27 2017
Yes. That's the behavior I'm referring to. Changing to a new printer should clear the error but I'm not sure why the current behavior was chosen. There might be some state that needs to be reset to avoid bad behavior. I haven't had the time to figure out why it behaves this way.
,
May 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a7b31e1ff636ee016885a18953745783c9825616 commit a7b31e1ff636ee016885a18953745783c9825616 Author: rbpotter <rbpotter@chromium.org> Date: Mon May 01 19:08:20 2017 Fix Print Preview failure state and add test Prevent print preview error state from being unrecoverable by resetting the state when the user selects a new printer. Add test to check that the state resets and to check that the response to the INVALID_SETTINGS event is correct. BUG= 708834 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2849733002 Cr-Commit-Position: refs/heads/master@{#468379} [modify] https://crrev.com/a7b31e1ff636ee016885a18953745783c9825616/chrome/browser/resources/print_preview/print_preview.js [modify] https://crrev.com/a7b31e1ff636ee016885a18953745783c9825616/chrome/test/data/webui/print_preview.js
,
May 2 2017
,
May 3 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d3b61aeab646c01a5e0a921a580e603f160678e3 commit d3b61aeab646c01a5e0a921a580e603f160678e3 Author: skau <skau@chromium.org> Date: Wed May 03 01:07:56 2017 Reduce the log level for printer capability fetch failure. If printer capability fetch fails, it is indicative of an error, but it is recoverable. So, it should be reduced to a warning. This enables testing of the failure case for printer capability retrieval. BUG= 708834 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2850353002 Cr-Commit-Position: refs/heads/master@{#468850} [modify] https://crrev.com/d3b61aeab646c01a5e0a921a580e603f160678e3/chrome/browser/resources/print_preview/data/destination_store.js [modify] https://crrev.com/d3b61aeab646c01a5e0a921a580e603f160678e3/chrome/test/data/webui/print_preview_destination_search_test.js
,
May 4 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by skau@chromium.org
, Apr 6 2017