1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50:28 +00:00

fix(inactive-user-server-notification): [PM-25130] Inactive User Server Notify - Fixed dep.

This commit is contained in:
Patrick Pimentel
2025-08-25 16:31:39 -04:00
parent 6f1661e247
commit bd028cce47
2 changed files with 15 additions and 8 deletions

View File

@@ -943,6 +943,7 @@ const safeProviders: SafeProvider[] = [
SignalRConnectionService,
AuthServiceAbstraction,
WebPushConnectionService,
ConfigService,
],
}),
safeProvider({

View File

@@ -184,16 +184,22 @@ export class DefaultServerNotificationsService implements ServerNotificationsSer
return;
}
// Allow-list of notification types that are safe to process for non-active users
const multiUserNotificationTypes = new Set<NotificationType>([NotificationType.AuthRequest]);
if (
await firstValueFrom(
this.configService.getFeatureFlag$(FeatureFlag.InactiveUserServerNotification),
)
) {
// Allow-list of notification types that are safe to process for non-active users
const multiUserNotificationTypes = new Set<NotificationType>([NotificationType.AuthRequest]);
const activeAccountId = await firstValueFrom(
this.accountService.activeAccount$.pipe(map((a) => a?.id)),
);
const activeAccountId = await firstValueFrom(
this.accountService.activeAccount$.pipe(map((a) => a?.id)),
);
const isActiveUser = activeAccountId === userId;
if (!isActiveUser && !multiUserNotificationTypes.has(notification.type)) {
return;
const isActiveUser = activeAccountId === userId;
if (!isActiveUser && !multiUserNotificationTypes.has(notification.type)) {
return;
}
}
switch (notification.type) {