From f4e46259ac0de725bea6521f41eddf9c7050a779 Mon Sep 17 00:00:00 2001 From: Rui Tome Date: Mon, 27 Jan 2025 16:20:06 +0000 Subject: [PATCH] Add feature flag check for PushSyncOrgKeysOnRevokeRestore in NotificationsService --- libs/common/src/services/notifications.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/common/src/services/notifications.service.ts b/libs/common/src/services/notifications.service.ts index d1fce510d9d..3bb7ccace5a 100644 --- a/libs/common/src/services/notifications.service.ts +++ b/libs/common/src/services/notifications.service.ts @@ -25,6 +25,8 @@ import { StateService } from "../platform/abstractions/state.service"; import { ScheduledTaskNames } from "../platform/scheduling/scheduled-task-name.enum"; import { TaskSchedulerService } from "../platform/scheduling/task-scheduler.service"; import { SyncService } from "../vault/abstractions/sync/sync.service.abstraction"; +import { ConfigService } from "../platform/abstractions/config/config.service"; +import { FeatureFlag } from "../enums/feature-flag.enum"; export class NotificationsService implements NotificationsServiceAbstraction { private signalrConnection: signalR.HubConnection; @@ -46,6 +48,7 @@ export class NotificationsService implements NotificationsServiceAbstraction { private authService: AuthService, private messagingService: MessagingService, private taskSchedulerService: TaskSchedulerService, + private configService: ConfigService, ) { this.taskSchedulerService.registerTaskHandler( ScheduledTaskNames.notificationsReconnectTimeout, @@ -170,7 +173,9 @@ export class NotificationsService implements NotificationsServiceAbstraction { break; case NotificationType.SyncOrgKeys: if (isAuthenticated) { - await this.apiService.refreshIdentityToken(); + if (this.configService.getFeatureFlag(FeatureFlag.PushSyncOrgKeysOnRevokeRestore)) { + await this.apiService.refreshIdentityToken(); + } await this.syncService.fullSync(true); // Stop so a reconnect can be made await this.signalrConnection.stop(); @@ -228,7 +233,10 @@ export class NotificationsService implements NotificationsServiceAbstraction { } try { - this.signalrConnection = this.setupConnection(); + if (this.configService.getFeatureFlag(FeatureFlag.PushSyncOrgKeysOnRevokeRestore)) { + this.signalrConnection = this.setupConnection(); + } + await this.signalrConnection.start(); this.connected = true; if (sync) {