Closed Bug 1606566 Opened 5 years ago Closed 5 years ago

"TypeError: info.PDFFormatVersion is undefined" when PDF header is invalid

Categories

(Firefox :: PDF Viewer, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 73
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- wontfix
firefox72 --- wontfix
firefox73 --- verified

People

(Reporter: robwu, Assigned: Snuffleupagus)

References

(Regression, )

Details

(Keywords: regression)

When the PDF version cannot be extracted from a PDF file, the PDF can still be displayed properly, but the console contains the following error:

TypeError: info.PDFFormatVersion is undefined

As a result, such PDF files won't be recorded in telemetry.

To reproduce, edit a PDF file and replace the %PDF-x.x part with whitespace. Then open that PDF file in Firefox (with MIME-type application/pdf; either from a server, or just from file:// ).

This regression is caused by https://github.com/mozilla/pdf.js/commit/31d71808e7f663af9eccd18da10009102a1702d7

Previously, the missing value was serialized as "undefined", and converted to an integer before sent to telemetry. The value would be reported as 0.
Now, due to the runtime error, nothing is sent to telemetry any more. I think that "other" would make more sense here.

Fixed by https://github.com/mozilla/pdf.js/pull/11463

Brendan, could you take care of evaluating whether the patch should be merged with m-c, and/or uplifted?

Flags: needinfo?(bdahl)
Depends on: 1606634
Flags: needinfo?(bdahl)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Assignee: nobody → jonas.jenwald
Target Milestone: --- → Firefox 73
Flags: qe-verify+

I reproduced the issue on Firefox Nightly (2020-01-01) under Windows 10 (x64), following the instructions from Comment 1.

The issue is fixed on RC1 73.0. Tests were performed on Windows 10 (x64), macOS 10.15, and Ubuntu 18.04 (x64).

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.