Firefox print dialog doesn't get past throbber & "Preparing Preview", with error console showing "Uncaught (in promise) TypeError: can't access property "id", matchedPaper is undefined"
Categories
(Toolkit :: Printing, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox81 | --- | unaffected |
firefox82 | --- | fixed |
firefox83 | --- | fixed |
People
(Reporter: dholbert, Unassigned)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [print2020_v82])
I'm spinning this off from bug 1661751, for what seems to be a newly reported regression in Firefox 82.
Quoting the relevant comments:
(Quoting to saahbs from bug 1661751 comment #4)
I have the same problem [print dialog doesn't get past throbber] on Linux on firefox from aurora channel. I noticed around 82.b0?? but it could have been earlier - I usually don't print from within Firefox.
Steps to repro:
- file -> print
- before it displays any options, it shows a spinner and doesn't make progress (so no option to try to print to a pdf).
My printing works otherwise (cups with default class pointing to a sole printer).
See screenshot at: http://www.saahbs.net/temp/0ea3c5/firefox-borked-printing.png
Hitting ESC does allow to return to browsing.
Creating a fresh profile and starting it with --safe-mode also repros.
And a later comment, checking the error console:
(Quoting to saahbs from bug 1661751 comment #13)
I was able to repro on 82.0b7 with print.tab_modal.enable = true.
I get the new preview UI, it is blank with a spinner and makes no progress.
Here is the error message when attempting to print example.com:
Uncaught (in promise) TypeError: can't access property "id", matchedPaper is undefined
refreshSettings chrome://global/content/print.js:434
init chrome://global/content/print.js:250
async* chrome://global/content/print.js:85
EventListener.handleEvent* chrome://global/content/print.js:82
print.js:434:9
I posted some analysis:
(Quoting Daniel Holbert [:dholbert] from bug 1661751 comment #14)
That points to this snippet of code in current trunk (it's identical to the code in beta, though the line number is a bit different):
https://searchfox.org/mozilla-central/rev/1a973762afcbc5066f73f1508b0c846872fe3952/toolkit/components/printing/content/print.js#423-438It looks like in your case:
(1) We're hitting the clause that says// We didn't find a good match. Take the first paper size
(2) ...but our collection of paper sizes is probably empty for some reason.
(3) So thematchedPaper = Object.values(...)[0]
ends up withundefined
(4) SomatchedPaper.id
ends up throwing an exception, and we never finish preparing the print dialog.sfoster, it looks like you've worked on that snippet of code -- would you mind taking a look here and adding some sort of error-handling code for the case where the
Object.values(...)
expression returns an empty collection and matchedPaper ends up undefined?
ni=sfoster per above.
Note: from code inspection (and from the timeline of when saahbs first noticed this), it looks to me like this is a regression from Bug 1663669. The "matchedPaper" usage here was added in that bug, as a rewrite of some older code, and that older code doesn't seem to have had this problem of using matchedPaper without having first checking it for truthiness.
--> Tentatively flagging as regression
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
(This feels like a P1, since the UI ends up completely broken/unreachable. Ideally we should get a fix uplifted to 82 for benefit of whatever users might get opted in to this new UI in that release.)
Updated•4 years ago
|
Comment 2•4 years ago
|
||
This is bug 1663503, the patch was just merged to beta/82 a few hours ago: https://bugzilla.mozilla.org/show_bug.cgi?id=1663503#c61
Updated•4 years ago
|
Updated•4 years ago
|
Description
•