1
0
mirror of https://github.com/bitwarden/server synced 2025-12-26 13:13:24 +00:00

[PM-20041] Deleting Notifications when Task is completed (#5896)

* mark all notifications associated with a security task as deleted when the task is completed

* fix spelling

* formatting

* refactor "Active" to "NonDeleted"

* refactor "Active" to "NonDeleted" for stored procedure

* only send notifications per user for each notification

* move notification status updates into the DB layer to save on multiple queries and insertions from the C#

* Only return UserIds from db layer

* omit userId from `MarkTaskAsCompletedCommand` query.

The userId from the notification will be used

* update UserIds

* consistency in comments regarding `taskId` and `UserId`
This commit is contained in:
Nick Krantz
2025-06-27 16:04:47 -05:00
committed by GitHub
parent c441fa27dd
commit 69b7600eab
10 changed files with 198 additions and 2 deletions

View File

@@ -32,4 +32,13 @@ public interface INotificationRepository : IRepository<Notification, Guid>
/// </returns>
Task<PagedResult<NotificationStatusDetails>> GetByUserIdAndStatusAsync(Guid userId, ClientType clientType,
NotificationStatusFilter? statusFilter, PageOptions pageOptions);
/// <summary>
/// Marks notifications as deleted by a taskId.
/// </summary>
/// <param name="taskId">The unique identifier of the task.</param>
/// <returns>
/// A collection of UserIds for the notifications that are now marked as deleted.
/// </returns>
Task<IEnumerable<Guid>> MarkNotificationsAsDeletedByTask(Guid taskId);
}