QA/Desktop Firefox/Firefox Health Report

From MozillaWiki
Jump to navigation Jump to search

Firefox Health Report

Project Lead Mike Connor [:mconnor]
Dev Lead Gregory Szorc [:gps]
QA Lead Anthony Hughes [:ashughes]
Status [ON TRACK] Signed off for Firefox 21 Beta

Firefox 21

Functionality

  • about:healthreport
  • dashboard for valid payloads
  • dashboard for broken payloads
  • opt-in/out
  • jank

FIXED Bug Verifications

Queries: target-milestone:21, status-firefox21:fixed

Bug QA Contact Status
bug 841554 Ensure FHR search engine works in non en-US locales Anthony Hughes
bug 827910 Only report "extension" and "plugin" types for full add-on details Anthony Hughes VERIFIED FIXED
bug 828720 FHR performance Telemetry Anthony Hughes VERIFIED FIXED
bug 828546 Firefox Health Report provider to record Places metrics Anthony Hughes VERIFIED FIXED
bug 829953 about:healthreport resets everytime you close that tab Anthony Hughes VERIFIED FIXED
bug 833612 Session restored time being reported as -1 Anthony Hughes VERIFIED FIXED
bug 843816 Detect duplicate sessions Anthony Hughes VERIFIED FIXED
bug 830090 Access key for "Choose What I Share" button in info bar is broken Anthony Hughes VERIFIED FIXED

Automated Tests

Manual Tests

  • [DONE] Load about:healthreport
  • [DONE] Show/hide details
  • [DONE] Learn more
  • [DONE] Enable/disable reporting
  • [DONE] Show report
  • [DONE] Verify through dogfooding that FHR does not cause additional jank

P1 Bugs (bugzilla query)

Full Query
ID Summary Priority Status
830142 The Learn More link for FHR doesn't go to a useful page P1 VERIFIED
830464 Obtain Privacy sign-off on all notification bar, pref pane, about:healthreport behavior P5 RESOLVED
832547 FHR user-facing page design P1 VERIFIED
840124 implement postMessage API for remote report P1 RESOLVED
842360 appinfo section is missing from FHR payload P4 RESOLVED
849879 FHR User-Facing Tips for v1 P1 RESOLVED
849947 FHR submission counts vs Blocklist ping P1 RESOLVED
852308 FHR error reporting policy for non-pre-release channels P1 RESOLVED

8 Total; 0 Open (0%); 6 Resolved (75%); 2 Verified (25%);


Interfacing with FHR

With the exception of about:healthreport, everything about the feature is in the background. This makes it somewhat difficult to test and inspect because there is nothing to see.

FHR is attached to the @mozilla.org/datareporting/service;1 XPCOM service, which should always be present and running in Firefox 21 and newer. The FHR-specific functionality is attached to an object on this service:

 let reporter = Cc["@mozilla.org/datareporting/service;1"]
                  .getService(Ci.nsISupports)
                  .wrappedJSObject
                  .healthReporter;

However, this property is lazy-loaded after app startup. Currently, we wait 45s on the first profile run and 10s on subsequent profile runs (these numbers may change).

When the healthReporter instance is constructed, it starts a long chain of asynchronous events required to initialize the instance. It opens a SQLite database, loads probes, etc. The construction on first profile run is one of the most expensive operations FHR will perform (it needs to create a DB and populate its schema, etc). It is important that you don't attempt to access any properties or functions on the .healthReporter instance until the promise returned by onInit() has resolved. e.g.

 let reporter = Cc["@mozilla.org/datareporting/service;1"].getService(Ci.nsISupports).wrappedJSObject.healthReporter;
 reporter.onInit(function onInitialized() { // This is when FHR is finally initialized. });

If you attempt to do anything before onInit() resolves, whatever you were trying to do may fail.

Once the FHR service is initialized, it starts monitoring the world and data is fed into it. All data is stored in a SQLite database, healthreport.sqlite in the profile directory.

Data upload is performed automatically and is scheduled for 24 hour intervals. Data upload will not occur until the user has been presented with a notification of Mozilla's data collection practices and privacy policy. For Firefox, this will manifest as a notification bar *on all windows and all tabs* sometime after the first app run with FHR present and before the first scheduled FHR upload. This is currently 12 hours after process start, although this may change.

Preferences

All preferences for FHR are in the datareporting. branch. This branch has the following sub-branches:

datareporting.healthreport.
Where all the FHR-specific preferences live.
datareporting.policy.
Preferences containing state for Mozilla's data collection and privacy policies.
datareporting.sessions.
Contains a history of previous and current session state. These preferences are periodically migrated to FHR's database.

The following preferences are relevant to testing:

datareporting.healthreport.lastPingTime
When we last uploaded a document to the server
datareporting.healthreport.lastSubmitID
The ID of the current document on the server
datareporting.healthreport.logging.consoleLevel
Level of logging to write to the Error Console. Set to Debug or Trace for lots of additional logging. By default, only errors are recorded.
datareporting.healthreport.nextDataSubmissionTime
When the next data submission is scheduled to occur. To trigger a soon'ish data submission, decrement the 3rd from front digit by 1 and wait up to a minute for the upload to be triggered. e.g. 13**6**4059453630 -> 13**5**4059453630.
datareporting.policy.dataSubmissionPolicyAccepted
Whether the data submission policy has been accepted. We will not submit data to the server unless this is true.