From 6f0585a14e58d0b2e58f5e64dfe2a2e3b580806a Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Fri, 29 Jul 2022 16:42:11 -0400 Subject: [PATCH 1/3] No issue: Do not save "about:crashparent" tab when saving state --- .../browser/session/storage/SessionStorage.kt | 11 ++++++-- .../session/storage/SessionStorageTest.kt | 28 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/components/browser/session-storage/src/main/java/mozilla/components/browser/session/storage/SessionStorage.kt b/components/browser/session-storage/src/main/java/mozilla/components/browser/session/storage/SessionStorage.kt index 1649e0084cf..38e765e0e7a 100644 --- a/components/browser/session-storage/src/main/java/mozilla/components/browser/session/storage/SessionStorage.kt +++ b/components/browser/session-storage/src/main/java/mozilla/components/browser/session/storage/SessionStorage.kt @@ -70,13 +70,18 @@ class SessionStorage( return true } - val stateToPersist = if (state.selectedTabId != null && state.selectedTab == null) { + // "about:crashparent" is meant for testing purposes only. If saved/restored then it will + // continue to crash the app until data is cleared. Therefore, we are filtering it out. + val updatedTabList = state.tabs.filterNot { it.content.url == "about:crashparent" } + val updatedState = state.copy(tabs = updatedTabList) + + val stateToPersist = if (updatedState.selectedTabId != null && updatedState.selectedTab == null) { // Needs investigation to figure out and prevent cause: // https://github.com/mozilla-mobile/android-components/issues/8417 logger.error("Selected tab ID set, but tab with matching ID not found. Clearing selection.") - state.copy(selectedTabId = null) + updatedState.copy(selectedTabId = null) } else { - state + updatedState } return synchronized(sessionFileLock) { diff --git a/components/browser/session-storage/src/test/java/mozilla/components/browser/session/storage/SessionStorageTest.kt b/components/browser/session-storage/src/test/java/mozilla/components/browser/session/storage/SessionStorageTest.kt index e4eddabf574..9fbf9d9c5f9 100644 --- a/components/browser/session-storage/src/test/java/mozilla/components/browser/session/storage/SessionStorageTest.kt +++ b/components/browser/session-storage/src/test/java/mozilla/components/browser/session/storage/SessionStorageTest.kt @@ -357,6 +357,34 @@ class SessionStorageTest { // the first one if all tabs have the same last access value. assertEquals("mozilla", browsingSession.selectedTabId) } + + @Test + fun `WHEN saving state with crash parent tab THEN don't save tab`() { + val state = BrowserState( + tabs = listOf( + createTab(url = "about:crashparent", id = "crash"), + createTab(url = "https://getpocket.com", id = "pocket") + ), + selectedTabId = "crash" + ) + + val engine = FakeEngine() + + val storage = SessionStorage(testContext, engine) + val persisted = storage.save(state) + assertTrue(persisted) + + // Read it back + val browsingSession = storage.restore() + assertNotNull(browsingSession!!) + + assertEquals(1, browsingSession.tabs.size) + assertEquals("https://getpocket.com", browsingSession.tabs[0].state.url) + + // Selected tab doesn't exist so we take to most recently accessed one, or + // the first one if all tabs have the same last access value. + assertEquals("pocket", browsingSession.selectedTabId) + } } internal fun TabSessionState.assertSameAs(tab: RecoverableTab) { From 95c0400e7634de8e17b58aad281669144bed6636 Mon Sep 17 00:00:00 2001 From: Jonathan Almeida Date: Mon, 8 Aug 2022 15:53:48 -0400 Subject: [PATCH 2/3] No issue: Update Nimbus plugin to use version 93.6.0 As part of mozilla-mobile/fenix#26041, we need to ensure we have at least version 93.6.0 of the plugin downloaded. The reason we are not using a newer version, even though they are available, is to reduce the complexity of things that go into the next AC release in order to get the Fenix experiment launched. --- .../mozilla/components/tooling/nimbus/NimbusGradlePlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tooling/nimbus-gradle-plugin/src/main/groovy/mozilla/components/tooling/nimbus/NimbusGradlePlugin.groovy b/components/tooling/nimbus-gradle-plugin/src/main/groovy/mozilla/components/tooling/nimbus/NimbusGradlePlugin.groovy index dbe0d81e300..d43002e7ad3 100644 --- a/components/tooling/nimbus-gradle-plugin/src/main/groovy/mozilla/components/tooling/nimbus/NimbusGradlePlugin.groovy +++ b/components/tooling/nimbus-gradle-plugin/src/main/groovy/mozilla/components/tooling/nimbus/NimbusGradlePlugin.groovy @@ -171,7 +171,7 @@ class NimbusPlugin implements Plugin { // a) this plugin is going to live in the AS repo (eventually) // See https://github.com/mozilla-mobile/android-components/issues/11422 for tying this // to a version that is specified in buildSrc/src/main/java/Dependencies.kt - return "93.5.0" + return "93.6.0" } // Try one or more hosts to download the given file. From 2cdbf4b341e4b03f485a5c9e6e0a290295db7dfb Mon Sep 17 00:00:00 2001 From: Mozilla L10n Automation Bot Date: Tue, 9 Aug 2022 00:04:30 +0000 Subject: [PATCH 3/3] Import l10n. --- components/lib/crash/src/main/res/values-fr/strings.xml | 3 +++ components/lib/crash/src/main/res/values-sl/strings.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/components/lib/crash/src/main/res/values-fr/strings.xml b/components/lib/crash/src/main/res/values-fr/strings.xml index 99b5534cf2b..87ebf25320a 100644 --- a/components/lib/crash/src/main/res/values-fr/strings.xml +++ b/components/lib/crash/src/main/res/values-fr/strings.xml @@ -25,6 +25,9 @@ Envoi du rapport de plantage à %1$s + + Collecte des données de plantage + Collecte des données de télémétrie du plantage diff --git a/components/lib/crash/src/main/res/values-sl/strings.xml b/components/lib/crash/src/main/res/values-sl/strings.xml index abc8a5fc324..a0a020d1c41 100644 --- a/components/lib/crash/src/main/res/values-sl/strings.xml +++ b/components/lib/crash/src/main/res/values-sl/strings.xml @@ -24,6 +24,9 @@ Pošiljanje poročila o sesutju organizaciji %1$s + + Zbiranje podatkov o sesutju + Zbiranje telemetričnih podatkov o sesutju