mirror of
https://github.com/bitwarden/browser
synced 2026-02-08 20:50:28 +00:00
docs(notification-processing): [PM-19877] System Notification Implementation - Removed incorrect comments for server notifications.
This commit is contained in:
@@ -451,7 +451,7 @@ describe("OverlayNotificationsBackground", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("web requests that trigger server notifications", () => {
|
||||
describe("web requests that trigger notifications", () => {
|
||||
const requestId = "123345";
|
||||
const pageDetails = mock<AutofillPageDetails>({ fields: [mock<AutofillField>()] });
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export class OverlayNotificationsBackground implements OverlayNotificationsBackg
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Initialize the overlay server notifications background service.
|
||||
* Initialize the overlay notifications background service.
|
||||
*/
|
||||
async init() {
|
||||
this.setupExtensionListeners();
|
||||
@@ -395,7 +395,7 @@ export class OverlayNotificationsBackground implements OverlayNotificationsBackg
|
||||
};
|
||||
|
||||
/**
|
||||
* This method attempts to trigger the add login, change password, or at-risk password server notifications
|
||||
* This method attempts to trigger the add login, change password, or at-risk password notifications
|
||||
* based on the modified login data and the tab details.
|
||||
*
|
||||
* @param requestId - The details of the web response
|
||||
@@ -462,7 +462,7 @@ export class OverlayNotificationsBackground implements OverlayNotificationsBackg
|
||||
case NotificationTypes.AtRiskPassword:
|
||||
return !modifyLoginData.newPassword;
|
||||
case NotificationTypes.Unlock:
|
||||
// Unlock server notifications are handled separately and do not require form data
|
||||
// Unlock notifications are handled separately and do not require form data
|
||||
return false;
|
||||
default:
|
||||
this.logService.error(`Unknown notification type: ${notificationType}`);
|
||||
|
||||
@@ -643,7 +643,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the form field data used for add login and change password server notifications.
|
||||
* Returns the form field data used for add login and change password notifications.
|
||||
*/
|
||||
private getFormFieldData = (): ModifyLoginCipherFormData => {
|
||||
return {
|
||||
|
||||
@@ -218,7 +218,7 @@ export class AtRiskPasswordsComponent implements OnInit {
|
||||
});
|
||||
}),
|
||||
concatMap((unreadTaskNotifications) => {
|
||||
// TODO: Investigate creating a bulk endpoint to mark server notifications as read
|
||||
// TODO: Investigate creating a bulk endpoint to mark notifications as read
|
||||
return concat(
|
||||
...unreadTaskNotifications.map((n) =>
|
||||
this.endUserNotificationService.markAsRead(n.id, userId),
|
||||
|
||||
@@ -1115,7 +1115,7 @@ const safeProviders: SafeProvider[] = [
|
||||
// This is a slightly odd dependency tree for a specialized api service
|
||||
// it depends on SyncService so that new data can be retrieved through the sync
|
||||
// rather than updating the OrganizationService directly. Instead OrganizationService
|
||||
// subscribes to sync server notifications and will update itself based on that.
|
||||
// subscribes to sync notifications and will update itself based on that.
|
||||
deps: [ApiServiceAbstraction, SyncService],
|
||||
}),
|
||||
safeProvider({
|
||||
|
||||
@@ -25,7 +25,7 @@ const SHOW_FAVICONS = new KeyDefinition(DOMAIN_SETTINGS_DISK, "showFavicons", {
|
||||
deserializer: (value: boolean) => value ?? true,
|
||||
});
|
||||
|
||||
// Domain exclusion list for server notifications
|
||||
// Domain exclusion list for notifications
|
||||
const NEVER_DOMAINS = new KeyDefinition(DOMAIN_SETTINGS_DISK, "neverDomains", {
|
||||
deserializer: (value: NeverDomains) => value ?? null,
|
||||
});
|
||||
@@ -64,7 +64,7 @@ export abstract class DomainSettingsService {
|
||||
setShowFavicons: (newValue: boolean) => Promise<void>;
|
||||
|
||||
/**
|
||||
* User-specified URIs for which the client server notifications should not appear
|
||||
* User-specified URIs for which the client notifications should not appear
|
||||
*/
|
||||
neverDomains$: Observable<NeverDomains>;
|
||||
setNeverDomains: (newValue: NeverDomains) => Promise<void>;
|
||||
|
||||
@@ -5,17 +5,17 @@ import { NotificationId, UserId } from "@bitwarden/common/types/guid";
|
||||
import { NotificationView } from "../models";
|
||||
|
||||
/**
|
||||
* A service for retrieving and managing server notifications for end users.
|
||||
* A service for retrieving and managing notifications for end users.
|
||||
*/
|
||||
export abstract class EndUserNotificationService {
|
||||
/**
|
||||
* Observable of all server notifications for the given user.
|
||||
* Observable of all notifications for the given user.
|
||||
* @param userId
|
||||
*/
|
||||
abstract notifications$(userId: UserId): Observable<NotificationView[]>;
|
||||
|
||||
/**
|
||||
* Observable of all unread server notifications for the given user.
|
||||
* Observable of all unread notifications for the given user.
|
||||
* @param userId
|
||||
*/
|
||||
abstract unreadNotifications$(userId: UserId): Observable<NotificationView[]>;
|
||||
@@ -35,13 +35,13 @@ export abstract class EndUserNotificationService {
|
||||
abstract markAsDeleted(notificationId: NotificationId, userId: UserId): Promise<void>;
|
||||
|
||||
/**
|
||||
* Clear all server notifications from state for the given user.
|
||||
* Clear all notifications from state for the given user.
|
||||
* @param userId
|
||||
*/
|
||||
abstract clearState(userId: UserId): Promise<void>;
|
||||
|
||||
/**
|
||||
* Creates a subscription to listen for end user push server notifications and notification status updates.
|
||||
* Creates a subscription to listen for end user push notifications and notification status updates.
|
||||
*/
|
||||
abstract listenForEndUserNotifications(): Subscription;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { NotificationView, NotificationViewData, NotificationViewResponse } from
|
||||
import { NOTIFICATIONS } from "../state/end-user-notification.state";
|
||||
|
||||
/**
|
||||
* The default number of server notifications to fetch from the API.
|
||||
* The default number of notifications to fetch from the API.
|
||||
*/
|
||||
export const DEFAULT_NOTIFICATION_PAGE_SIZE = 50;
|
||||
|
||||
@@ -30,7 +30,7 @@ const getLoggedInUserIds = map<Record<UserId, AuthenticationStatus>, UserId[]>((
|
||||
);
|
||||
|
||||
/**
|
||||
* A service for retrieving and managing server notifications for end users.
|
||||
* A service for retrieving and managing notifications for end users.
|
||||
*/
|
||||
export class DefaultEndUserNotificationService implements EndUserNotificationService {
|
||||
constructor(
|
||||
@@ -100,7 +100,7 @@ export class DefaultEndUserNotificationService implements EndUserNotificationSer
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper observable to filter server notifications by the notification type and user ids
|
||||
* Helper observable to filter notifications by the notification type and user ids
|
||||
* Returns EMPTY if no user ids are provided
|
||||
* @param userIds
|
||||
* @private
|
||||
@@ -121,7 +121,7 @@ export class DefaultEndUserNotificationService implements EndUserNotificationSer
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a subscription to listen for end user push server notifications and notification status updates.
|
||||
* Creates a subscription to listen for end user push notifications and notification status updates.
|
||||
*/
|
||||
listenForEndUserNotifications(): Subscription {
|
||||
return this.authService.authStatuses$
|
||||
@@ -139,7 +139,7 @@ export class DefaultEndUserNotificationService implements EndUserNotificationSer
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the server notifications from the API and updates the local state
|
||||
* Fetches the notifications from the API and updates the local state
|
||||
* @param userId
|
||||
* @private
|
||||
*/
|
||||
@@ -164,7 +164,7 @@ export class DefaultEndUserNotificationService implements EndUserNotificationSer
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the local state with server notifications and returns the updated state
|
||||
* Replaces the local state with notifications and returns the updated state
|
||||
* @param userId
|
||||
* @param notifications
|
||||
* @private
|
||||
@@ -178,7 +178,7 @@ export class DefaultEndUserNotificationService implements EndUserNotificationSer
|
||||
|
||||
/**
|
||||
* Updates the local state adding the new notification or updates an existing one with the same id
|
||||
* Returns the entire updated server notifications state
|
||||
* Returns the entire updated notifications state
|
||||
* @param userId
|
||||
* @param notification
|
||||
* @private
|
||||
@@ -203,7 +203,7 @@ export class DefaultEndUserNotificationService implements EndUserNotificationSer
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the local state for server notifications
|
||||
* Returns the local state for notifications
|
||||
* @param userId
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ export abstract class TaskService {
|
||||
abstract markAsComplete(taskId: SecurityTaskId, userId: UserId): Promise<void>;
|
||||
|
||||
/**
|
||||
* Creates a subscription for pending security task server notifications or completed syncs for unlocked users.
|
||||
* Creates a subscription for pending security task notifications or completed syncs for unlocked users.
|
||||
*/
|
||||
abstract listenForTaskNotifications(): Subscription;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export type ToastOptions = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Presents toast server notifications
|
||||
* Presents toast notifications
|
||||
**/
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class ToastService {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Toast as BaseToastrComponent, ToastPackage, ToastrService } from "ngx-t
|
||||
import { ToastComponent } from "./toast.component";
|
||||
|
||||
/**
|
||||
* Toasts are ephemeral server notifications. They most often communicate the result of a user action. Due to their ephemeral nature, long messages and critical alerts should not utilize toasts.
|
||||
* Toasts are ephemeral notifications. They most often communicate the result of a user action. Due to their ephemeral nature, long messages and critical alerts should not utilize toasts.
|
||||
*/
|
||||
@Component({
|
||||
template: `
|
||||
|
||||
Reference in New Issue
Block a user