- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: add notification deduplication trigger#14172
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| -- name: EnqueueNotificationMessage :exec | ||
| INSERT INTO notification_messages (id, notification_template_id, user_id, method, payload, targets, created_by) | ||
| INSERT INTO notification_messages (id, notification_template_id, user_id, method, payload, targets, created_by, created_at) |
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 addedcreated_at to be passed in to make the dedupe hash testable by using Quartz to advance the clock.
Signed-off-by: Danny Kopping <danny@coder.com>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
mafredri left a comment
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.
Flagged some stuff but looks pretty straight-forward to me, approved.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
johnstcn left a comment
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.
Approving to unblock; previous comments still hold.
Signed-off-by: Danny Kopping <danny@coder.com>
mafredri left a comment
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.
Still LGTM 👍🏻
| "github.com/coder/quartz" | ||
| "github.com/coder/serpent" |
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.
Another instance of import grouping, this is the job of the tooling tbh (and it's failing), so up to you if you want to fix it 😄. (There are actually a few more of these too but I'll leave those uncommented.)
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'll leave this for now; we need the tooling to be updated as you suggest.
Thanks for pointing this out though
johnstcn left a comment
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.
![]()
Uh oh!
There was an error while loading.Please reload this page.
Closescoder/internal#26
Maintains a deduplication hash for each
notification_messageentry on insert/update to prevent identical notifications from being enqueued on the same day.I plumbed in
coder/quartzto help manipulate time to make theTestNotificationDuplicatessimple and readable.