Skip to content

Commit 285aa10

Browse files
authored
[PM-20035] Remove native-carousel-flow feature flag. (#1521)
1 parent 48dd1b7 commit 285aa10

File tree

7 files changed

+9
-53
lines changed

7 files changed

+9
-53
lines changed

BitwardenShared/Core/Platform/Models/Enum/FeatureFlag.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ enum FeatureFlag: String, CaseIterable, Codable {
4747
/// A feature flag to enable additional error reporting.
4848
case mobileErrorReporting = "mobile-error-reporting"
4949

50-
/// A feature flag for the intro carousel flow.
51-
case nativeCarouselFlow = "native-carousel-flow"
52-
5350
/// A feature flag for the create account flow.
5451
case nativeCreateAccountFlow = "native-create-account-flow"
5552

@@ -135,7 +132,6 @@ enum FeatureFlag: String, CaseIterable, Codable {
135132
.emailVerification,
136133
.enableAuthenticatorSync,
137134
.importLoginsFlow,
138-
.nativeCarouselFlow,
139135
.nativeCreateAccountFlow,
140136
.refactorSsoDetailsEndpoint,
141137
.restrictCipherItemDeletion,

BitwardenShared/Core/Platform/Models/Enum/FeatureFlagTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ final class FeatureFlagTests: BitwardenTestCase {
2626
XCTAssertTrue(FeatureFlag.emailVerification.isRemotelyConfigured)
2727
XCTAssertTrue(FeatureFlag.enableAuthenticatorSync.isRemotelyConfigured)
2828
XCTAssertTrue(FeatureFlag.importLoginsFlow.isRemotelyConfigured)
29-
XCTAssertTrue(FeatureFlag.nativeCarouselFlow.isRemotelyConfigured)
3029
XCTAssertTrue(FeatureFlag.nativeCreateAccountFlow.isRemotelyConfigured)
3130
XCTAssertTrue(FeatureFlag.refactorSsoDetailsEndpoint.isRemotelyConfigured)
3231
XCTAssertTrue(FeatureFlag.restrictCipherItemDeletion.isRemotelyConfigured)

BitwardenShared/Core/Platform/Services/Stores/AppSettingsStoreTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ class AppSettingsStoreTests: BitwardenTestCase { // swiftlint:disable:this type_
418418
}
419419

420420
XCTAssertTrue(try XCTUnwrap(subject.debugFeatureFlag(name: FeatureFlag.emailVerification.rawValue)))
421-
XCTAssertTrue(try XCTUnwrap(subject.debugFeatureFlag(name: FeatureFlag.nativeCarouselFlow.rawValue)))
422421
XCTAssertTrue(try XCTUnwrap(subject.debugFeatureFlag(name: FeatureFlag.enableAuthenticatorSync.rawValue)))
423422
XCTAssertTrue(try XCTUnwrap(subject.debugFeatureFlag(name: FeatureFlag.nativeCreateAccountFlow.rawValue)))
424423
}

BitwardenShared/UI/Auth/AuthRouterTests.swift

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,10 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
190190
XCTAssertEqual(errorReporter.errors as? [BitwardenTestError], [.example])
191191
}
192192

193-
/// `handleAndRoute(_ :)` redirects `.didCompleteAuth` to `.landing` and doesn't set the
194-
/// carousel shown flag if the carousel feature flag is off.
195-
func test_handleAndRoute_didCompleteAuth_carouselNotShown() async {
196-
authRepository.activeAccount = .fixture()
197-
configService.featureFlagsBool[.nativeCarouselFlow] = false
198-
199-
let route = await subject.handleAndRoute(.didCompleteAuth)
200-
201-
XCTAssertEqual(route, .complete)
202-
XCTAssertFalse(stateService.introCarouselShown)
203-
}
204-
205193
/// `handleAndRoute(_ :)` redirects `.didCompleteAuth` to `.landing` and sets the carousel shown
206-
/// flag if the carousel feature flag is on and the carousel hasn't been shown yet.
194+
/// flag if the carousel hasn't been shown yet.
207195
func test_handleAndRoute_didCompleteAuth_carouselShown() async {
208196
authRepository.activeAccount = .fixture()
209-
configService.featureFlagsBoolPreAuth[.nativeCarouselFlow] = true
210197

211198
let route = await subject.handleAndRoute(.didCompleteAuth)
212199

@@ -215,10 +202,9 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
215202
}
216203

217204
/// `handleAndRoute(_ :)` redirects `.didCompleteAuth` to `.vaultUnlockSetup` and sets the
218-
/// carousel shown flag if the carousel feature flag is on and the carousel hasn't been shown yet.
205+
/// carousel shown flag and the carousel hasn't been shown yet.
219206
func test_handleAndRoute_didCompleteAuth_carouselShown_vaultUnlockSetup() async {
220207
authRepository.activeAccount = .fixture()
221-
configService.featureFlagsBoolPreAuth[.nativeCarouselFlow] = true
222208
stateService.activeAccount = .fixture()
223209
stateService.accountSetupVaultUnlock["1"] = .incomplete
224210

@@ -956,8 +942,6 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
956942
/// `handleAndRoute(_ :)` redirects `.didStart` to `.introCarousel` if there's no accounts and
957943
/// the carousel flow is enabled.
958944
func test_handleAndRoute_didStart_carouselFlow() async {
959-
configService.featureFlagsBoolPreAuth[.nativeCarouselFlow] = true
960-
961945
let route = await subject.handleAndRoute(.didStart)
962946

963947
XCTAssertEqual(route, .introCarousel)
@@ -966,7 +950,6 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
966950
/// `handleAndRoute(_ :)` redirects `.didStart` to `.landing` if there's no accounts, the
967951
/// carousel flow is enabled, but the carousel has already been shown.
968952
func test_handleAndRoute_didStart_carouselFlow_carouselShown() async {
969-
configService.featureFlagsBool[.nativeCarouselFlow] = true
970953
stateService.introCarouselShown = true
971954

972955
let route = await subject.handleAndRoute(.didStart)
@@ -976,8 +959,6 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
976959

977960
/// `handleAndRoute(_ :)` redirects `.didStart` to `.landing` if it's running in an extension.
978961
func test_handleAndRoute_didStart_carouselFlow_extension() async {
979-
configService.featureFlagsBool[.nativeCarouselFlow] = true
980-
981962
subject = AuthRouter(
982963
isInAppExtension: true,
983964
services: ServiceContainer.withMocks(
@@ -999,7 +980,6 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
999980
func test_handleAndRoute_didStart_carouselFlow_existingAccountNeverLock() async {
1000981
let account = Account.fixture()
1001982
authRepository.activeAccount = .fixture()
1002-
configService.featureFlagsBoolPreAuth[.nativeCarouselFlow] = true
1003983
vaultTimeoutService.vaultTimeout[account.profile.userId] = .never
1004984

1005985
let route = await subject.handleAndRoute(.didStart)
@@ -1014,7 +994,6 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
1014994
func test_handleAndRoute_didStart_carouselFlow_existingAccountNeverLockOnManuallylocked() async {
1015995
let account = Account.fixture()
1016996
authRepository.activeAccount = .fixture()
1017-
configService.featureFlagsBoolPreAuth[.nativeCarouselFlow] = true
1018997
vaultTimeoutService.vaultTimeout[account.profile.userId] = .never
1019998
stateService.isAuthenticated[account.profile.userId] = true
1020999
stateService.manuallyLockedAccounts[account.profile.userId] = true
@@ -1047,13 +1026,6 @@ final class AuthRouterTests: BitwardenTestCase { // swiftlint:disable:this type_
10471026
XCTAssertTrue(authRepository.unlockVaultWithNeverlockKeyCalled)
10481027
}
10491028

1050-
/// `handleAndRoute(_ :)` redirects `.didStart` to `.landing`
1051-
/// when there are no accounts.
1052-
func test_handleAndRoute_didStart_noAccounts() async {
1053-
let route = await subject.handleAndRoute(.didStart)
1054-
XCTAssertEqual(route, .landing)
1055-
}
1056-
10571029
/// `handleAndRoute(_ :)` redirects `.didStart` to `.vaultUnlock`
10581030
/// when the account is set to timeout on app start with a lock vault action.
10591031
func test_handleAndRoute_didStart_timeoutOnAppRestart_lock() async {

BitwardenShared/UI/Auth/Extensions/AuthRouter+Redirects.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,8 @@ extension AuthRouter {
229229
///
230230
func preparedStartRoute() async -> AuthRoute {
231231
guard let activeAccount = try? await configureActiveAccount(shouldSwitchAutomatically: true) else {
232-
// If no account can be set to active, go to the landing or carousel screen.
233-
let isCarouselEnabled: Bool = await services.configService.getFeatureFlag(
234-
.nativeCarouselFlow,
235-
isPreAuth: true
236-
)
237232
let introCarouselShown = await services.stateService.getIntroCarouselShown()
238-
let shouldShowCarousel = isCarouselEnabled && !introCarouselShown && !isInAppExtension
233+
let shouldShowCarousel = !introCarouselShown && !isInAppExtension
239234
return shouldShowCarousel ? .introCarousel : .landing
240235
}
241236

@@ -405,9 +400,8 @@ extension AuthRouter {
405400
/// existing account or once logging in or creating an account is successful.
406401
///
407402
private func setCarouselShownIfEnabled() async {
408-
let isCarouselEnabled: Bool = await services.configService.getFeatureFlag(.nativeCarouselFlow, isPreAuth: true)
409403
let introCarouselShown = await services.stateService.getIntroCarouselShown()
410-
if isCarouselEnabled, !introCarouselShown {
404+
if !introCarouselShown {
411405
await services.stateService.setIntroCarouselShown(true)
412406
}
413407
}

BitwardenShared/UI/Platform/DebugMenu/DebugMenuViewTests.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,11 @@ class DebugMenuViewTests: BitwardenTestCase {
8888
@MainActor
8989
func test_snapshot_debugMenuWithFeatureFlags() {
9090
processor.state.featureFlags = [
91-
.init(
92-
feature: .emailVerification,
93-
isEnabled: true
94-
),
95-
.init(
96-
feature: .nativeCarouselFlow,
97-
isEnabled: false
98-
),
91+
.init(feature: .emailVerification, isEnabled: true),
9992
]
100-
assertSnapshot(of: subject, as: .defaultPortrait)
93+
assertSnapshot(
94+
of: subject,
95+
as: .defaultPortrait
96+
)
10197
}
10298
}
-10.5 KB
Loading

0 commit comments

Comments
 (0)