Skip to content

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

Closed
coder/coder
#14172
@dannykopping

Description

@dannykopping

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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions