mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
[PM-24747] Remove chromium importer feature flag (#16749)
This commit is contained in:
@@ -35,7 +35,6 @@ export enum FeatureFlag {
|
||||
/* Tools */
|
||||
DesktopSendUIRefresh = "desktop-send-ui-refresh",
|
||||
UseSdkPasswordGenerators = "pm-19976-use-sdk-password-generators",
|
||||
UseChromiumImporter = "pm-23982-chromium-importer",
|
||||
|
||||
/* DIRT */
|
||||
EventBasedOrganizationIntegrations = "event-based-organization-integrations",
|
||||
@@ -81,7 +80,6 @@ export const DefaultFeatureFlagValue = {
|
||||
/* Tools */
|
||||
[FeatureFlag.DesktopSendUIRefresh]: FALSE,
|
||||
[FeatureFlag.UseSdkPasswordGenerators]: FALSE,
|
||||
[FeatureFlag.UseChromiumImporter]: FALSE,
|
||||
|
||||
/* DIRT */
|
||||
[FeatureFlag.EventBasedOrganizationIntegrations]: FALSE,
|
||||
|
||||
@@ -341,19 +341,6 @@ describe("ImportService", () => {
|
||||
expect(result.loaders).toContain(Loader.file);
|
||||
});
|
||||
|
||||
it("should exclude chromium loader when feature flag is disabled", async () => {
|
||||
const testType: ImportType = "bravecsv"; // bravecsv supports both file and chromium loaders
|
||||
featureFlagSubject.next(false);
|
||||
|
||||
const metadataPromise = firstValueFrom(importService.metadata$(typeSubject));
|
||||
typeSubject.next(testType);
|
||||
|
||||
const result = await metadataPromise;
|
||||
|
||||
expect(result.loaders).not.toContain(Loader.chromium);
|
||||
expect(result.loaders).toContain(Loader.file);
|
||||
});
|
||||
|
||||
it("should update when type$ changes", async () => {
|
||||
const emissions: ImporterMetadata[] = [];
|
||||
const subscription = importService.metadata$(typeSubject).subscribe((metadata) => {
|
||||
@@ -373,27 +360,6 @@ describe("ImportService", () => {
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
|
||||
it("should update when feature flag changes", async () => {
|
||||
const testType: ImportType = "bravecsv"; // Use bravecsv which supports chromium loader
|
||||
const emissions: ImporterMetadata[] = [];
|
||||
|
||||
const subscription = importService.metadata$(typeSubject).subscribe((metadata) => {
|
||||
emissions.push(metadata);
|
||||
});
|
||||
|
||||
typeSubject.next(testType);
|
||||
featureFlagSubject.next(true);
|
||||
|
||||
// Wait for emissions
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
|
||||
expect(emissions).toHaveLength(2);
|
||||
expect(emissions[0].loaders).not.toContain(Loader.chromium);
|
||||
expect(emissions[1].loaders).toContain(Loader.chromium);
|
||||
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
|
||||
it("should update when both type$ and feature flag change", async () => {
|
||||
const emissions: ImporterMetadata[] = [];
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from "@bitwarden/admin-console/common";
|
||||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { DeviceType } from "@bitwarden/common/enums";
|
||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
|
||||
import { PinServiceAbstraction } from "@bitwarden/common/key-management/pin/pin.service.abstraction";
|
||||
import { ImportCiphersRequest } from "@bitwarden/common/models/request/import-ciphers.request";
|
||||
@@ -138,18 +137,16 @@ export class ImportService implements ImportServiceAbstraction {
|
||||
}
|
||||
|
||||
metadata$(type$: Observable<ImportType>): Observable<ImporterMetadata> {
|
||||
const browserEnabled$ = this.system.configService.getFeatureFlag$(
|
||||
FeatureFlag.UseChromiumImporter,
|
||||
);
|
||||
const client = this.system.environment.getClientType();
|
||||
const capabilities$ = combineLatest([type$, browserEnabled$]).pipe(
|
||||
map(([type, enabled]) => {
|
||||
const capabilities$ = combineLatest([type$]).pipe(
|
||||
map(([type]) => {
|
||||
let loaders = availableLoaders(type, client);
|
||||
|
||||
// Mac App Store is currently disabled due to sandboxing.
|
||||
let isUnsupported = this.system.environment.isMacAppStore();
|
||||
|
||||
if (enabled && type === "bravecsv") {
|
||||
// disable the chromium loader for Brave on Windows only
|
||||
if (type === "bravecsv") {
|
||||
try {
|
||||
const device = this.system.environment.getDevice();
|
||||
const isWindowsDesktop = device === DeviceType.WindowsDesktop;
|
||||
@@ -160,8 +157,8 @@ export class ImportService implements ImportServiceAbstraction {
|
||||
isUnsupported = true;
|
||||
}
|
||||
}
|
||||
// If the feature flag is disabled, or if the browser is unsupported, remove the chromium loader
|
||||
if (!enabled || isUnsupported) {
|
||||
// If the browser is unsupported, remove the chromium loader
|
||||
if (isUnsupported) {
|
||||
loaders = loaders?.filter((loader) => loader !== Loader.chromium);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user