From ae2fb3279cb2a9da02af8d8fd99af3e435d4a0c2 Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Mon, 5 Dec 2022 13:58:10 -0500 Subject: [PATCH 1/5] Revert "Enable content migration flow feature flags." This reverts commit dd1ecb8ab7ce50a4c164ce8139fa51d2a8772634. --- WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift index 5546bd0be35d..4c0a345d7cd8 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift @@ -113,9 +113,9 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag { case .jetpackPowered: return true case .jetpackPoweredBottomSheet: - return true + return false case .contentMigration: - return true + return false case .newJetpackLandingScreen: return true case .newWordPressLandingScreen: From 45e556beade262eacde154fd25c9951aee629bdc Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Mon, 5 Dec 2022 13:58:31 -0500 Subject: [PATCH 2/5] Revert "Add release notes." This reverts commit 440b8e8fd0977ae19a459f9b711d20cc84c25419. --- RELEASE-NOTES.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 4a12142a3c59..e5f3947817ee 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -4,7 +4,6 @@ 21.3 ----- -* [***] Adds a smooth, opt-in transition to the Jetpack app. [#19714] * [*] [internal] When a user migrates to the Jetpack app and allows notifications, WordPress app notifications are disabled. This is released disabled and is behind a feature flag. [#19616, #19611, #19590] * [*] Fixed a minor UI issue where the segmented control under My SIte was being clipped when "Home" is selected. [#19595] * [*] Fixed an issue where the site wasn't removed and the app wasn't refreshed after disconnecting the site from WordPress.com. [#19634] From 58f33a0783e69424fcf2867bb602d222c4822359 Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Mon, 5 Dec 2022 15:04:31 -0500 Subject: [PATCH 3/5] Put the ContentMigrationCoordinator process behind the Content Migration feature flag. --- WordPress/Classes/System/WordPressAppDelegate.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 7502ac31560d..23f6532f16f4 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -328,10 +328,12 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate { setupWordPressExtensions() - // Start proactively exporting WP data in the background if the conditions are fulfilled. - // This needs to be called after `setupWordPressExtensions` because it updates the stored data. - DispatchQueue.global().async { - ContentMigrationCoordinator.shared.startOnceIfNeeded() + if FeatureFlag.contentMigration.enabled { + // Start proactively exporting WP data in the background if the conditions are fulfilled. + // This needs to be called after `setupWordPressExtensions` because it updates the stored data. + DispatchQueue.global().async { + ContentMigrationCoordinator.shared.startOnceIfNeeded() + } } shortcutCreator.createShortcutsIf3DTouchAvailable(AccountHelper.isLoggedIn) From 493c621b93ee657bab831be991e2fbfe3b9d6efe Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Mon, 5 Dec 2022 16:33:33 -0500 Subject: [PATCH 4/5] Revamp showUI logic and factor in content migration feature flag for Jetpack. --- .../Classes/System/JetpackWindowManager.swift | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift b/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift index 99eab365dce4..42963903fd61 100644 --- a/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift +++ b/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift @@ -15,21 +15,25 @@ class JetpackWindowManager: WindowManager { } override func showUI(for blog: Blog?) { - // If the user is logged in and has blogs sync'd to their account - if AccountHelper.isLoggedIn && AccountHelper.hasBlogs { - showAppUI(for: blog) + if AccountHelper.isLoggedIn { + if AccountHelper.hasBlogs { + // If the user is logged in and has blogs sync'd to their account + showAppUI(for: blog) + } else { + // If the user doesn't have any blogs, but they're still logged in, log them out + // the `logOutDefaultWordPressComAccount` method will trigger the `showSignInUI` automatically + AccountHelper.logOutDefaultWordPressComAccount() + } return } - guard AccountHelper.isLoggedIn else { - self.migrationTracker.trackContentImportEligibility(eligible: shouldImportMigrationData) - shouldImportMigrationData ? importAndShowMigrationContent(blog) : showSignInUI() + guard FeatureFlag.contentMigration.enabled else { + showSignInUI() return } - // If the user doesn't have any blogs, but they're still logged in, log them out - // the `logOutDefaultWordPressComAccount` method will trigger the `showSignInUI` automatically - AccountHelper.logOutDefaultWordPressComAccount() + self.migrationTracker.trackContentImportEligibility(eligible: shouldImportMigrationData) + shouldImportMigrationData ? importAndShowMigrationContent(blog) : showSignInUI() } func importAndShowMigrationContent(_ blog: Blog? = nil) { From 85f4bfb274bd009d8bef680e495e9aecff307e10 Mon Sep 17 00:00:00 2001 From: "Tanner W. Stokes" Date: Mon, 5 Dec 2022 17:37:19 -0500 Subject: [PATCH 5/5] Add immediate returns to improve readability. --- WordPress/Jetpack/Classes/System/JetpackWindowManager.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift b/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift index 42963903fd61..1ab8f3a95d07 100644 --- a/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift +++ b/WordPress/Jetpack/Classes/System/JetpackWindowManager.swift @@ -19,12 +19,13 @@ class JetpackWindowManager: WindowManager { if AccountHelper.hasBlogs { // If the user is logged in and has blogs sync'd to their account showAppUI(for: blog) + return } else { // If the user doesn't have any blogs, but they're still logged in, log them out // the `logOutDefaultWordPressComAccount` method will trigger the `showSignInUI` automatically AccountHelper.logOutDefaultWordPressComAccount() + return } - return } guard FeatureFlag.contentMigration.enabled else {