1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 22:13:32 +00:00

fix(extension-device-approval): [PM-14943] Answering Service Full Implementation - Added Justin's change and things seem to be working better. Still broken on new account.

This commit is contained in:
Patrick Pimentel
2025-08-29 15:29:05 -04:00
parent 43fe8f36d9
commit ce5a16f686

View File

@@ -69,6 +69,9 @@ export class DefaultServerNotificationsService implements ServerNotificationsSer
this.notifications$ = this.configService
.getFeatureFlag$(FeatureFlag.InactiveUserServerNotification)
.pipe(
tap((value) => {
console.debug(`[DefaultServerNotificationsService] feature flag value for inactive user server notifications: ${value}`);
}),
distinctUntilChanged(),
switchMap((inactiveUserServerNotificationEnabled) => {
if (inactiveUserServerNotificationEnabled) {
@@ -76,6 +79,9 @@ export class DefaultServerNotificationsService implements ServerNotificationsSer
return this.accountService.accounts$.pipe(
map((accounts) => Object.keys(accounts) as UserId[]),
distinctUntilChanged(),
tap((value) => {
console.debug(`[DefaultServerNotificationsService] new accounts: ${value}`);
}),
switchMap((userIds) => {
if (userIds.length === 0) {
return EMPTY;
@@ -119,7 +125,13 @@ export class DefaultServerNotificationsService implements ServerNotificationsSer
private userNotifications$(userId: UserId) {
return this.environmentService.getEnvironment$(userId).pipe(
map((env) => env.getNotificationsUrl()),
tap((value) => {
console.debug(`[DefaultServerNotificationsService] userNotifications$ before: ${value}`);
}),
distinctUntilChanged(),
tap((value) => {
console.debug(`[DefaultServerNotificationsService] userNotifications$ after: ${value}`);
}),
switchMap((notificationsUrl) => {
if (notificationsUrl === DISABLED_NOTIFICATIONS_URL) {
console.debug(
@@ -135,6 +147,7 @@ export class DefaultServerNotificationsService implements ServerNotificationsSer
private userNotificationsHelper$(userId: UserId, notificationsUrl: string) {
return this.hasAccessToken$(userId).pipe(
distinctUntilChanged(),
switchMap((hasAccessToken) => {
if (!hasAccessToken) {
console.debug(