Skip to content

Commit d8b0e52

Browse files
authored
[PM-21841] Remove accountDeprovisioning feature flag and all the references (#1627)
1 parent 7e5c61e commit d8b0e52

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

BitwardenShared/Core/Auth/Repositories/AuthRepository.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,6 @@ extension DefaultAuthRepository: AuthRepository {
741741
}
742742

743743
func isUserManagedByOrganization() async throws -> Bool {
744-
guard await configService.getFeatureFlag(.accountDeprovisioning) else {
745-
return false
746-
}
747-
748744
let orgs = try await organizationService.fetchAllOrganizations()
749745
return orgs.contains { $0.userIsManagedByOrganization }
750746
}

BitwardenShared/Core/Auth/Repositories/AuthRepositoryTests.swift

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,20 +1114,8 @@ class AuthRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo
11141114
XCTAssertFalse(value)
11151115
}
11161116

1117-
/// `isUserManagedByOrganization` returns false when the feature flag is off.
1118-
func test_isUserManagedByOrganization_true_featureFlagOff() async throws {
1119-
stateService.accounts = [.fixture(profile: .fixture(userId: "1"))]
1120-
try await stateService.setActiveAccount(userId: "1")
1121-
organizationService.fetchAllOrganizationsResult =
1122-
.success([.fixture(id: "One", userIsManagedByOrganization: true)])
1123-
1124-
let value = try await subject.isUserManagedByOrganization()
1125-
XCTAssertFalse(value)
1126-
}
1127-
11281117
/// `isUserManagedByOrganization` returns false when the user isn't managed by an organization.
1129-
func test_isUserManagedByOrganization_false_featureFlagON() async throws {
1130-
configService.featureFlagsBool[.accountDeprovisioning] = true
1118+
func test_isUserManagedByOrganization_false() async throws {
11311119
stateService.accounts = [.fixture(profile: .fixture(userId: "1"))]
11321120
try await stateService.setActiveAccount(userId: "1")
11331121
organizationService.fetchAllOrganizationsResult = .success([.fixture(id: "One")])
@@ -1137,8 +1125,7 @@ class AuthRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo
11371125
}
11381126

11391127
/// `isUserManagedByOrganization` returns false when the user doesn't belong to an organization.
1140-
func test_isUserManagedByOrganization_noOrgs_featureFlagON() async throws {
1141-
configService.featureFlagsBool[.accountDeprovisioning] = true
1128+
func test_isUserManagedByOrganization_noOrgs() async throws {
11421129
stateService.accounts = [.fixture(profile: .fixture(userId: "1"))]
11431130
try await stateService.setActiveAccount(userId: "1")
11441131
organizationService.fetchAllOrganizationsResult = .success([])
@@ -1148,8 +1135,7 @@ class AuthRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo
11481135
}
11491136

11501137
/// `isUserManagedByOrganization` returns true if the user is managed by an organization.
1151-
func test_isUserManagedByOrganization_true_featureFlagON() async throws {
1152-
configService.featureFlagsBool[.accountDeprovisioning] = true
1138+
func test_isUserManagedByOrganization_true() async throws {
11531139
stateService.accounts = [.fixture(profile: .fixture(userId: "1"))]
11541140
try await stateService.setActiveAccount(userId: "1")
11551141
organizationService.fetchAllOrganizationsResult =
@@ -1160,8 +1146,7 @@ class AuthRepositoryTests: BitwardenTestCase { // swiftlint:disable:this type_bo
11601146
}
11611147

11621148
/// `isUserManagedByOrganization` returns true if the user is managed by at least one organization.
1163-
func test_isUserManagedByOrganization_true_multipleOrgs_featureON() async throws {
1164-
configService.featureFlagsBool[.accountDeprovisioning] = true
1149+
func test_isUserManagedByOrganization_true_multipleOrgs() async throws {
11651150
stateService.accounts = [.fixture(profile: .fixture(userId: "1"))]
11661151
try await stateService.setActiveAccount(userId: "1")
11671152
organizationService.fetchAllOrganizationsResult =

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import Foundation
55

66
/// An enum to represent a feature flag sent by the server
77
extension FeatureFlag: @retroactive CaseIterable {
8-
/// A feature flag to enable/disable account deprovisioning.
9-
static let accountDeprovisioning = FeatureFlag(rawValue: "pm-10308-account-deprovisioning")
10-
118
/// A feature flag to enable/disable the ability to add a custom domain for anonAddy users.
129
static let anonAddySelfHostAlias = FeatureFlag(rawValue: "anon-addy-self-host-alias")
1310

@@ -78,7 +75,6 @@ extension FeatureFlag: @retroactive CaseIterable {
7875

7976
public static var allCases: [FeatureFlag] {
8077
[
81-
.accountDeprovisioning,
8278
.anonAddySelfHostAlias,
8379
.appIntents,
8480
.cxpExportMobile,

0 commit comments

Comments
 (0)