From 58372116cf0a08e94598677caa0732c90547efdc Mon Sep 17 00:00:00 2001 From: rr-bw <102181210+rr-bw@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:02:58 -0800 Subject: [PATCH] remove validationService and update logService messages --- .../extension-auth-request-answering.service.spec.ts | 4 ---- .../extension-auth-request-answering.service.ts | 5 +---- apps/browser/src/background/main.background.ts | 1 + apps/browser/src/popup/services/services.module.ts | 2 -- apps/desktop/src/app/services/services.module.ts | 2 -- .../desktop-auth-request-answering.service.spec.ts | 4 ---- .../desktop-auth-request-answering.service.ts | 5 +---- 7 files changed, 3 insertions(+), 20 deletions(-) diff --git a/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.spec.ts b/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.spec.ts index a7b2c858278..377b1cd1882 100644 --- a/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.spec.ts +++ b/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.spec.ts @@ -11,7 +11,6 @@ import { PendingAuthRequestsStateService } from "@bitwarden/common/auth/services import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { ActionsService } from "@bitwarden/common/platform/actions"; import { ButtonLocation, @@ -34,7 +33,6 @@ describe("ExtensionAuthRequestAnsweringService", () => { let platformUtilsService: MockProxy; let systemNotificationsService: MockProxy; let logService: MockProxy; - let validationService: MockProxy; let sut: AuthRequestAnsweringService; @@ -54,7 +52,6 @@ describe("ExtensionAuthRequestAnsweringService", () => { platformUtilsService = mock(); systemNotificationsService = mock(); logService = mock(); - validationService = mock(); // Common defaults authService.activeAccountStatus$ = of(AuthenticationStatus.Locked); @@ -84,7 +81,6 @@ describe("ExtensionAuthRequestAnsweringService", () => { platformUtilsService, systemNotificationsService, logService, - validationService, ); }); diff --git a/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.ts b/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.ts index 84b51d7fbdf..c4a6fd1cc7a 100644 --- a/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.ts +++ b/apps/browser/src/auth/services/auth-request-answering/extension-auth-request-answering.service.ts @@ -10,7 +10,6 @@ import { MasterPasswordServiceAbstraction } from "@bitwarden/common/key-manageme import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { ActionsService } from "@bitwarden/common/platform/actions"; import { ButtonLocation, @@ -35,7 +34,6 @@ export class ExtensionAuthRequestAnsweringService private readonly platformUtilsService: PlatformUtilsService, private readonly systemNotificationsService: SystemNotificationsService, private readonly logService: LogService, - private readonly validationService: ValidationService, ) { super( accountService, @@ -73,8 +71,7 @@ export class ExtensionAuthRequestAnsweringService const accountInfo = accounts[authRequestUserId]; if (!accountInfo) { - this.logService.error(`Account not found for userId: ${authRequestUserId}`); - this.validationService.showError(`Account not found for userId: ${authRequestUserId}`); + this.logService.error("Account not found for authRequestUserId"); return; } diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index d2f805cbec9..baa45c312b8 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1180,6 +1180,7 @@ export default class MainBackground { this.i18nService, this.platformUtilsService, this.systemNotificationService, + this.logService, ); this.serverNotificationsService = new DefaultServerNotificationsService( diff --git a/apps/browser/src/popup/services/services.module.ts b/apps/browser/src/popup/services/services.module.ts index bcec4c0a33f..3244967617f 100644 --- a/apps/browser/src/popup/services/services.module.ts +++ b/apps/browser/src/popup/services/services.module.ts @@ -101,7 +101,6 @@ import { AbstractStorageService, ObservableStorageService, } from "@bitwarden/common/platform/abstractions/storage.service"; -import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { ActionsService } from "@bitwarden/common/platform/actions"; import { Message, MessageListener, MessageSender } from "@bitwarden/common/platform/messaging"; // eslint-disable-next-line no-restricted-imports -- Used for dependency injection @@ -498,7 +497,6 @@ const safeProviders: SafeProvider[] = [ PlatformUtilsService, SystemNotificationsService, LogService, - ValidationService, ], }), safeProvider({ diff --git a/apps/desktop/src/app/services/services.module.ts b/apps/desktop/src/app/services/services.module.ts index 43bd26683f2..27736fcb4aa 100644 --- a/apps/desktop/src/app/services/services.module.ts +++ b/apps/desktop/src/app/services/services.module.ts @@ -90,7 +90,6 @@ import { SdkLoadService } from "@bitwarden/common/platform/abstractions/sdk/sdk- import { StateService as StateServiceAbstraction } from "@bitwarden/common/platform/abstractions/state.service"; import { AbstractStorageService } from "@bitwarden/common/platform/abstractions/storage.service"; import { SystemService as SystemServiceAbstraction } from "@bitwarden/common/platform/abstractions/system.service"; -import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { Message, MessageListener, MessageSender } from "@bitwarden/common/platform/messaging"; // eslint-disable-next-line no-restricted-imports -- Used for dependency injection import { SubjectMessageSender } from "@bitwarden/common/platform/messaging/internal"; @@ -500,7 +499,6 @@ const safeProviders: SafeProvider[] = [ PendingAuthRequestsStateService, I18nServiceAbstraction, LogService, - ValidationService, ], }), ]; diff --git a/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.spec.ts b/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.spec.ts index 08ffc64a0ce..e9d0b1876e8 100644 --- a/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.spec.ts +++ b/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.spec.ts @@ -9,7 +9,6 @@ import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/for import { PendingAuthRequestsStateService } from "@bitwarden/common/auth/services/auth-request-answering/pending-auth-requests.state"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; -import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { LogService } from "@bitwarden/logging"; import { UserId } from "@bitwarden/user-core"; @@ -23,7 +22,6 @@ describe("DesktopAuthRequestAnsweringService", () => { let pendingAuthRequestsState: MockProxy; let i18nService: MockProxy; let logService: MockProxy; - let validationService: MockProxy; let sut: AuthRequestAnsweringService; @@ -49,7 +47,6 @@ describe("DesktopAuthRequestAnsweringService", () => { pendingAuthRequestsState = mock(); i18nService = mock(); logService = mock(); - validationService = mock(); // Common defaults authService.activeAccountStatus$ = of(AuthenticationStatus.Locked); @@ -75,7 +72,6 @@ describe("DesktopAuthRequestAnsweringService", () => { pendingAuthRequestsState, i18nService, logService, - validationService, ); }); diff --git a/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.ts b/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.ts index 54794aa2714..1b928746d80 100644 --- a/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.ts +++ b/apps/desktop/src/auth/services/auth-request-answering/desktop-auth-request-answering.service.ts @@ -8,7 +8,6 @@ import { PendingAuthRequestsStateService } from "@bitwarden/common/auth/services import { MasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; -import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; import { LogService } from "@bitwarden/logging"; import { UserId } from "@bitwarden/user-core"; @@ -24,7 +23,6 @@ export class DesktopAuthRequestAnsweringService protected readonly pendingAuthRequestsState: PendingAuthRequestsStateService, private readonly i18nService: I18nService, private readonly logService: LogService, - private readonly validationService: ValidationService, ) { super( accountService, @@ -68,8 +66,7 @@ export class DesktopAuthRequestAnsweringService const accountInfo = accounts[authRequestUserId]; if (!accountInfo) { - this.logService.error(`Account not found for userId: ${authRequestUserId}`); - this.validationService.showError(`Account not found for userId: ${authRequestUserId}`); + this.logService.error("Account not found for authRequestUserId"); return; }