-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[PM-20041] Deleting Notifications when Task is completed #5896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
β¦n the task is completed
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5896 +/- ##
==========================================
+ Coverage 47.73% 51.01% +3.28%
==========================================
Files 1665 1666 +1
Lines 75014 75084 +70
Branches 6755 6761 +6
==========================================
+ Hits 35806 38304 +2498
+ Misses 37743 35260 -2483
- Partials 1465 1520 +55 β View full report in Codecov by Sentry. π New features to boost your workflow:
|
New Issues (3)Checkmarx found the following issues in this Pull Request
|
src/Core/NotificationCenter/Repositories/INotificationRepository.cs
Outdated
Show resolved
Hide resolved
src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs
Outdated
Show resolved
Hide resolved
src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs
Outdated
Show resolved
Hide resolved
β¦e queries and insertions from the C#
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused about the notification spread related to the task.
src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs
Outdated
Show resolved
Hide resolved
src/Core/NotificationCenter/Repositories/INotificationRepository.cs
Outdated
Show resolved
Hide resolved
src/Sql/NotificationCenter/dbo/Stored Procedures/Notification_MarkAsDeletedByTask.sql
Outdated
Show resolved
Hide resolved
src/Sql/NotificationCenter/dbo/Stored Procedures/Notification_MarkAsDeletedByTask.sql
Outdated
Show resolved
Hide resolved
The userId from the notification will be used
β¦/pm-20041/mark-task-complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me now. Thanks for working through this with me.
Testing will still be important to see the performance and effect across several users' "inboxes" so let's be sure to include that in testing notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work on this! π I only noticed a comment in the sprocs that is now out of date after some back and forth in the other discussions on the PR.
BEGIN | ||
SET NOCOUNT ON; | ||
|
||
-- Collect NotificationIds as they are altered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
βοΈ Tiny nit, but we're collecting UserIds here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BEGIN | ||
SET NOCOUNT ON; | ||
|
||
-- Collect NotificationIds as they are altered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
βοΈ Tiny nit, but we're collecting UserIds here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// </summary> | ||
/// <param name="taskId">The unique identifier of the task.</param> | ||
/// <returns> | ||
/// A collection of users ids for the notifications that are now marked as deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are βοΈing, the different forms of "ID" triggered my OCD but I chose not to mention it π so fix those if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm all for it 963c7e9
β¦/pm-20041/mark-task-complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferring to your team for final approval.
|
ποΈ Tracking
PM-20041
Client PR: bitwarden/clients#14980
π Objective
When a security task is marked as complete, all notifications associated with that task should be marked as deleted.
GetActiveByTaskIdAsync
query to find all non-deleted notifications associated with a task id.MarkNotificationsForTaskAsDeletedCommand
to mark all notifications as deleted for that task.MarkNotificationDeletedCommand
.β If there should be some authorization checks outside of the
SecurityTasks
checks, let me know.πΈ Screenshots
mark-notification-as-deleted.mov