From db59947b6020d4467560c2978849c0f40d9151b2 Mon Sep 17 00:00:00 2001 From: Patrick Pimentel Date: Thu, 24 Jul 2025 11:13:17 -0400 Subject: [PATCH] fix(notification-processing): [PM-19877] System Notification Implementation - Fixed renaming of private member variable notificationsService to serverNotificationsService. --- apps/browser/src/background/idle.background.ts | 6 +++--- apps/browser/src/background/main.background.ts | 13 ++++++------- apps/browser/src/background/runtime.background.ts | 6 ++---- apps/web/src/app/app.component.ts | 6 +++--- apps/web/src/app/core/init.service.ts | 4 ++-- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/apps/browser/src/background/idle.background.ts b/apps/browser/src/background/idle.background.ts index da890566442..6fd555f4287 100644 --- a/apps/browser/src/background/idle.background.ts +++ b/apps/browser/src/background/idle.background.ts @@ -20,7 +20,7 @@ export default class IdleBackground { constructor( private vaultTimeoutService: VaultTimeoutService, - private notificationsService: ServerNotificationsService, + private serverNotificationsService: ServerNotificationsService, private accountService: AccountService, private vaultTimeoutSettingsService: VaultTimeoutSettingsService, ) { @@ -34,9 +34,9 @@ export default class IdleBackground { const idleHandler = (newState: string) => { if (newState === "active") { - this.notificationsService.reconnectFromActivity(); + this.serverNotificationsService.reconnectFromActivity(); } else { - this.notificationsService.disconnectFromInactivity(); + this.serverNotificationsService.disconnectFromInactivity(); } }; if (this.idle.onStateChanged && this.idle.setDetectionInterval) { diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index ae0f5f25b62..9bf7fb7c90b 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -346,7 +346,7 @@ export default class MainBackground { importService: ImportServiceAbstraction; exportService: VaultExportServiceAbstraction; searchService: SearchServiceAbstraction; - notificationsService: ServerNotificationsService; + serverNotificationsService: ServerNotificationsService; systemNotificationService: SystemNotificationsService; actionsService: ActionsService; stateService: StateServiceAbstraction; @@ -1145,7 +1145,7 @@ export default class MainBackground { this.systemNotificationService = new UnsupportedSystemNotificationsService(); } - this.notificationsService = new DefaultServerNotificationsService( + this.serverNotificationsService = new DefaultServerNotificationsService( this.logService, this.syncService, this.appIdService, @@ -1216,7 +1216,6 @@ export default class MainBackground { this, this.autofillService, this.platformUtilsService as BrowserPlatformUtilsService, - this.notificationsService, this.autofillSettingsService, this.processReloadService, this.environmentService, @@ -1255,7 +1254,7 @@ export default class MainBackground { this.apiService, this.organizationService, this.authService, - this.notificationsService, + this.serverNotificationsService, messageListener, ); @@ -1332,7 +1331,7 @@ export default class MainBackground { this.idleBackground = new IdleBackground( this.vaultTimeoutService, - this.notificationsService, + this.serverNotificationsService, this.accountService, this.vaultTimeoutSettingsService, ); @@ -1390,7 +1389,7 @@ export default class MainBackground { this.endUserNotificationService = new DefaultEndUserNotificationService( this.stateProvider, this.apiService, - this.notificationsService, + this.serverNotificationsService, this.authService, this.logService, ); @@ -1484,7 +1483,7 @@ export default class MainBackground { setTimeout(async () => { await this.fullSync(false); this.backgroundSyncService.init(); - this.notificationsService.startListening(); + this.serverNotificationsService.startListening(); this.taskService.listenForTaskNotifications(); diff --git a/apps/browser/src/background/runtime.background.ts b/apps/browser/src/background/runtime.background.ts index 1af268da01d..8a154c72bba 100644 --- a/apps/browser/src/background/runtime.background.ts +++ b/apps/browser/src/background/runtime.background.ts @@ -15,7 +15,6 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag import { MessageListener, isExternalMessage } from "@bitwarden/common/platform/messaging"; import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags"; import { Utils } from "@bitwarden/common/platform/misc/utils"; -import { ServerNotificationsService } from "@bitwarden/common/platform/notifications"; import { CipherType } from "@bitwarden/common/vault/enums"; import { VaultMessages } from "@bitwarden/common/vault/enums/vault-messages.enum"; import { BiometricsCommands } from "@bitwarden/key-management"; @@ -46,9 +45,8 @@ export default class RuntimeBackground { private main: MainBackground, private autofillService: AutofillService, private platformUtilsService: BrowserPlatformUtilsService, - private notificationsService: ServerNotificationsService, private autofillSettingsService: AutofillSettingsServiceAbstraction, - private processReloadSerivce: ProcessReloadServiceAbstraction, + private processReloadService: ProcessReloadServiceAbstraction, private environmentService: BrowserEnvironmentService, private messagingService: MessagingService, private logService: LogService, @@ -241,7 +239,7 @@ export default class RuntimeBackground { await closeUnlockPopout(); } - this.processReloadSerivce.cancelProcessReload(); + this.processReloadService.cancelProcessReload(); if (item) { await BrowserApi.focusWindow(item.commandToRetry.sender.tab.windowId); diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index e19bddce338..68692c8d5b4 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -73,7 +73,7 @@ export class AppComponent implements OnDestroy, OnInit { private keyService: KeyService, private collectionService: CollectionService, private searchService: SearchService, - private notificationsService: ServerNotificationsService, + private serverNotificationsService: ServerNotificationsService, private stateService: StateService, private eventUploadService: EventUploadService, protected policyListService: PolicyListService, @@ -341,9 +341,9 @@ export class AppComponent implements OnDestroy, OnInit { private idleStateChanged() { if (this.isIdle) { - this.notificationsService.disconnectFromInactivity(); + this.serverNotificationsService.disconnectFromInactivity(); } else { - this.notificationsService.reconnectFromActivity(); + this.serverNotificationsService.reconnectFromActivity(); } } } diff --git a/apps/web/src/app/core/init.service.ts b/apps/web/src/app/core/init.service.ts index 6d0a6c25fa6..72951658b23 100644 --- a/apps/web/src/app/core/init.service.ts +++ b/apps/web/src/app/core/init.service.ts @@ -28,7 +28,7 @@ import { VersionService } from "../platform/version.service"; export class InitService { constructor( @Inject(WINDOW) private win: Window, - private notificationsService: ServerNotificationsService, + private serverNotificationsService: ServerNotificationsService, private vaultTimeoutService: DefaultVaultTimeoutService, private i18nService: I18nServiceAbstraction, private eventUploadService: EventUploadServiceAbstraction, @@ -67,7 +67,7 @@ export class InitService { await this.userAutoUnlockKeyService.setUserKeyInMemoryIfAutoUserKeySet(activeAccount.id); } - this.notificationsService.startListening(); + this.serverNotificationsService.startListening(); await this.vaultTimeoutService.init(true); await this.i18nService.init(); (this.eventUploadService as EventUploadService).init(true);