Bug 1471375 - Reports about missing activity stream content on new tab page and about:preferences#home panel. r=k88hudson, a=RyanVM
authorEd Lee <edilee@mozilla.com>
Mon, 02 Jul 2018 12:04:19 -0400
changeset 473795 1b56c49591c5
parent 473794 6b6ded8230f1
child 473796 ced0b5dc71eb
push id1737
push userryanvm@gmail.com
push dateMon, 02 Jul 2018 16:05:08 +0000
treeherdermozilla-release@ced0b5dc71eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersk88hudson, RyanVM
bugs1471375
milestone61.0.1
Bug 1471375 - Reports about missing activity stream content on new tab page and about:preferences#home panel. r=k88hudson, a=RyanVM
browser/extensions/activity-stream/install.rdf.in
browser/extensions/activity-stream/lib/Store.jsm
browser/extensions/activity-stream/test/unit/lib/Store.test.js
--- a/browser/extensions/activity-stream/install.rdf.in
+++ b/browser/extensions/activity-stream/install.rdf.in
@@ -3,17 +3,17 @@
 #filter substitution
 
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>activity-stream@mozilla.org</em:id>
     <em:type>2</em:type>
     <em:bootstrap>true</em:bootstrap>
     <em:unpack>false</em:unpack>
-    <em:version>2018.05.30.0900-c6d48b86</em:version>
+    <em:version>2018.06.29.1026-fa231556</em:version>
     <em:name>Activity Stream</em:name>
     <em:description>A rich visual history feed and a reimagined home page make it easier than ever to find exactly what you're looking for in Firefox.</em:description>
     <em:multiprocessCompatible>true</em:multiprocessCompatible>
 
     <em:targetApplication>
       <Description>
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
         <em:minVersion>@MOZ_APP_VERSION@</em:minVersion>
--- a/browser/extensions/activity-stream/lib/Store.jsm
+++ b/browser/extensions/activity-stream/lib/Store.jsm
@@ -147,17 +147,21 @@ this.Store = class Store {
   async _initIndexedDB(telemetryKey) {
     this.dbStorage = new ActivityStreamStorage({
       storeNames: ["sectionPrefs", "snippets"],
       telemetry: this.feeds.get(telemetryKey)
     });
     // Accessing the db causes the object stores to be created / migrated.
     // This needs to happen before other instances try to access the db, which
     // would update only a subset of the stores to the latest version.
-    await this.dbStorage.db; // eslint-disable-line no-unused-expressions
+    try {
+      await this.dbStorage.db; // eslint-disable-line no-unused-expressions
+    } catch (e) {
+      this.dbStorage.telemetry = null;
+    }
   }
 
   /**
    * uninit -  Uninitalizes each feed, clears them, and destroys the message
    *           manager channel.
    *
    * @return {type}  description
    */
--- a/browser/extensions/activity-stream/test/unit/lib/Store.test.js
+++ b/browser/extensions/activity-stream/test/unit/lib/Store.test.js
@@ -154,16 +154,26 @@ describe("Store", () => {
       assert.calledWithExactly(store._initIndexedDB, "feeds.telemetry");
     });
     it("should access the db property of indexedDB", async () => {
       store._initIndexedDB.restore();
       await store.init(new Map());
 
       assert.calledOnce(dbStub);
     });
+    it("should reset ActivityStreamStorage telemetry if opening the db fails", async () => {
+      store._initIndexedDB.restore();
+      // Force an IndexedDB error
+      dbStub.rejects();
+
+      await store.init(new Map());
+
+      assert.calledOnce(dbStub);
+      assert.isNull(store.dbStorage.telemetry);
+    });
     it("should not initialize the feed if the Pref is set to false", async () => {
       sinon.stub(store, "initFeed");
       store._prefs.set("foo", false);
       await store.init(new Map([["foo", () => {}]]));
       assert.notCalled(store.initFeed);
     });
     it("should observe the pref branch", async () => {
       sinon.stub(store._prefs, "observeBranch");