snooze icon indicating copy to clipboard operation
snooze copied to clipboard

Detect duplicate notifications

Open atymic opened this issue 6 years ago • 8 comments

For example, when a job fails part way through and is retried it's possible to end up with a bunch of duplicate scheduled notifications.

Detecting this and throwing an exception or maybe silent fail? Should be behind a config option

atymic avatar Oct 02 '19 04:10 atymic

Adding target type/id in #20 will make this much easier.

atymic avatar Oct 17 '19 02:10 atymic

So we just check the notification_type and the target_id and the send time right? What is a good buffer time range for predicting duplicates? Same hour?

thomasjohnkane avatar Oct 20 '19 07:10 thomasjohnkane

Do you think this should happen at creation or send?

thomasjohnkane avatar Oct 20 '19 11:10 thomasjohnkane

What is a good buffer time range for predicting duplicates? Same hour?

I was actually just thinking exact match

Do you think this should happen at creation or send?

Creation.

atymic avatar Oct 20 '19 11:10 atymic

Couldn't this be as simple as change create to firstOrCreate on line #50 in the ScheduledNotification wrapper? @atymic

thomasjohnkane avatar Oct 26 '19 04:10 thomasjohnkane

Couldn't this be as simple as change create to firstOrCreate on line #50 in the ScheduledNotification wrapper? @atymic

Yep, that would probably work. Just need to make sure were don't apply it to anon notifications. Will PR soon :)

atymic avatar Oct 27 '19 06:10 atymic

@atymic - will you remind me why not with anon notifications?

thomasjohnkane avatar Nov 18 '19 03:11 thomasjohnkane

In an anon notification the recipient/channel data is inside the serialized target object (which will be different depending on the order, time, etc)

atymic avatar Nov 18 '19 03:11 atymic