Bug 1379374 - Write tabs to disk that don't have a tab type yet. r=snorp, a=sledru
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 11 Aug 2017 19:10:14 +0200
changeset 414525 db83b30e6c00016939d4b5752b4e16684e018706
parent 414524 7241df9e83ed802c70a7cdce3cee5df344279cad
child 414526 361d734f989121b92495c61e6fc6e29cb4bcbaba
push id1503
push userryanvm@gmail.com
push dateFri, 11 Aug 2017 20:49:54 +0000
treeherdermozilla-release@361d734f9891 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, sledru
bugs1379374, 1351808
Bug 1379374 - Write tabs to disk that don't have a tab type yet. r=snorp, a=sledru Tabs that are restored as background tabs have their session store data simply copied in from the session file without any further processing. This means that the data will be lacking the tab type attribute, which was introduced for 55 and used to decide whether that tab should be saved to disk or not. The implementation from Bug 1351808 didn't account for this, therefore without this fix background tabs that have been restored from a version < 55 and haven't been touched during the first session after the update will be excluded from the session store save file and lost. MozReview-Commit-ID: 1VlUvT2uS8K
--- a/mobile/android/components/SessionStore.js
+++ b/mobile/android/components/SessionStore.js
@@ -1073,17 +1073,17 @@ SessionStore.prototype = {
       privateData.windows.push({ tabs: [] });
       // Split the session data into private and non-private data objects.
       // Non-private session data will be saved to disk, and private session
       // data will be sent to Java for Android to hold it in memory.
       for (let i = 0; i < win.tabs.length; ++i) {
         let tab = win.tabs[i];
-        if (tab.type != "BROWSING") {
+        if (tab.type && tab.type != "BROWSING") {
         let savedWin = tab.isPrivate ? privateData.windows[winIndex] : normalData.windows[winIndex];
         if (win.selectedTabId === tab.tabId) {
           savedWin.selected = savedWin.tabs.length; // 1-based index