Page MenuHomePhabricator

Prevent duplicate notifications about blocking tasks
Open, Needs TriagePublic

Description

If I've subscribed to two different tasks and someone marks the first task as a task blocking the second, I'll get two emails about it. Ideally, this should be just one notification.

Event Timeline

ivo created this task.Mar 18 2016, 10:05 AM
ivo added a project: Maniphest.

See also T7013, and maybe T9161.

epriestley reopened this task as Open.EditedMar 18 2016, 3:38 PM
epriestley added a subscriber: epriestley.

This isn't really the same as T7013 or T9161. T7013 was intended as a pure infrastructure optimization, I just named it really badly. And even if we had the fanciest rules imaginable, T9161 wouldn't help, because this case is currently unknowable.

One side of this action creates the other transaction, and then both queue their publisher daemons, and neither side has sent or really figured out who will actually receive the email yet. So neither side of the transaction can say "the user already got an email about this", since one hasn't been sent.

We could always drop one side of this transaction (and you can already throw away half the transaction with "One of the tasks a task is blocked by changes status." in Notification preferences), but you'll miss cases when you were not a recipient of the other mail.

We could guess who the recipients are, but we'll get this wrong sometimes. The actual mail may be sent later, and uses the values at execution time (e.g., project members and policies), not the values when the action originally happened.

We could suppress half the mail and add the recipients to the other half, but this will break threading and generally look weird.

We could delay sending one of the mails until the other one sends, so we can know the recipient list.

All of this is very complicated and I believe this is the only situation where it occurs in any application, although it may occur more in the future with things like build failure notifications.

ivo added a comment.EditedMar 18 2016, 5:47 PM

I just remembered another similar scenario for which this happens frequently. If someone creates a new revision for a task I'm subscribed to and simultaneously adds me as a reviewer, I'll get two emails about it.

chad added a subscriber: chad.Mar 18 2016, 6:11 PM

It's expected, and I'm not convinced the work to reduce that to one email is viable or worth attempting to solve. That is, you may have rules set up to already handle this in your email client (like to move "reviews" to a separate folder). Doing magical things server side leads to likely user confusion and additional support work in the upstream. Personally, I understand I get two emails, but I also maintain two threads with history in my inbox. Having a new email that isn't threaded to either or just one, would be problematic.

eadler added a project: Restricted Project.Aug 5 2016, 5:05 PM