Ensure that the viewer telemetry reporting, and fallback code, runs in development mode and GENERIC builds #11522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While only the
MOZCENTRAL
builds will actually do anything meaningful with the telemetry data, none of the code in question actually runs at all in e.g. development mode.[1]This seems bad since it essentially means that this code is completely untested, despite being quite important for the built-in Firefox PDF viewer, and this thus ought to be fixed.
In this case, the explanation for the current state of the code should be "for historical reasons". Before the viewer was split into the current components and before the pre-processor was improved, back when all code resided in the
web/viewer.js
file, the telemetry reporting was done with directFirefoxCom
calls. However, with the dummyDefaultExternalServices.reportTelemetry
method there's nothing actually preventing attempting to report telemetry in any type of build.NOTE: By running this code in GENERIC builds as well, in addition to just locally, the viewer part of telemetry reporting becomes tested e.g. in preview builds too which should help with reviewing.
[1] When fixing bug 1606566, I had to edit the relevant
PDFJSDev
checks to be able to actually test the changes locally.