Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
dannykopping merged 3 commits intomainfromdk/notif-dedupe
Aug 21, 2024
Merged

Conversation

dannykopping
Copy link
Contributor

@dannykoppingdannykopping commentedAug 5, 2024
edited
Loading

Closescoder/internal#26

Maintains a deduplication hash for eachnotification_message entry on insert/update to prevent identical notifications from being enqueued on the same day.

I plumbed incoder/quartz to help manipulate time to make theTestNotificationDuplicates simple and readable.

@@ -13,14 +13,15 @@ WHERE nt.id = @notification_template_id
AND u.id = @user_id;

-- 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)
Copy link
ContributorAuthor

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.

johnstcn and mafredri reacted with thumbs up emoji
Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Member

@mafredrimafredri left a 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.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelAug 14, 2024
@github-actionsgithub-actionsbot removed the staleThis issue is like stale bread. labelAug 20, 2024
Copy link
Member

@johnstcnjohnstcn left a 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.

Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Still LGTM 👍🏻

@@ -13,6 +13,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/coder/quartz"

"github.com/coder/serpent"
Copy link
Member

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

Copy link
ContributorAuthor

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

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

:shipit:

@dannykoppingdannykopping merged commit9c8c6a9 intomainAug 21, 2024
28 checks passed
@dannykoppingdannykopping deleted the dk/notif-dedupe branchAugust 21, 2024 09:18
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 21, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

enhancement: prevent notifications with identical content from being sent for recurring events
3 participants
@dannykopping@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp