Skip to content

enhancement: prevent notifications with identical content from being sent for recurring events #26

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

Closed
dannykopping opened this issue Jul 26, 2024 · 0 comments · Fixed by coder/coder#14172
Assignees

Comments

@dannykopping
Copy link
Collaborator

Reported by @ammario in https://codercom.slack.com/archives/C0736HHMLD9/p1721832571772409

For example:
The autobuild failure event may trigger multiple times for a workspace, and there is not much value (in fact there's negative value) in notifying about this identical situation in a short span of time.

image

In the above query, it shows how Ammar received identical notifications for both his blah and josh workspaces (btw: lol) within a few hours of each other.

We should prevent duplicate notifications from being enqueued.

In the original System-Generated Notifications RFC, I spoke about adding a dedupe_hash column on the notification_messages table which would hash the contents of the notification (e.g. md5(payload+method+user+template+targets)) and add a unique index on that. We should also factor in the created_at time, so that duplicate notifications are only prevented from sending on the same day - but not for as long as an entry exists in the table (after 1 week the entries are purged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant