# Email notifications get skipped on busy topics

**URL:** https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422
**Category:** Bug
**Created:** [Janeiro 25, 2016, 5:03am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422 "2016-01-25T05:03:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Janeiro 25, 2016, 5:03am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422/1 "2016-01-25T05:03:17Z")

</div>

This has already popped up twice:

[https://meta.discourse.org/t/missing-notification-emails-on-busy-topics/13380](https://meta.discourse.org/t/missing-notification-emails-on-busy-topics/13380)

and

> [@Urgent: help troubleshoot missing notifications for watched categories](https://meta.discourse.org/t/urgent-help-troubleshoot-missing-notifications-for-watched-categories/32339):
>
> I’m campaigning hard in my community to build trust in the email delivery system, and today came across an odd situation where it appears that a new post did not trigger emails to all users watching the category. I’d be grateful for any and all advice on troubleshooting this issue. 57 people have access to the category and I can confirm are watching it. According to mandrill, only 54 emails were sent out. I am still comparing lists of email addresses but have already found one where I know for …

I just reprod it locally and am working on fix but I wanted to explain what is going on:

To repro:

1. On account A watch a topic
2. On account B reply to topic twice.

What happens:

1. We generate a notification for A saying that a topic got a reply
2. We delete notification (1)
3. We create a new notification that rolls up (1)

This rollup behavior messes up the email notifier, it tries looking up notification (1) but it is no longer in the table, so that notification is skipped.

This leads to 2 very bad side-effects

1. Email notification can be delayed way beyond the default window (10 minutes) … repro is quite simple, post a reply in watched a topic every 9 minutes and you will not trigger notifications ever.

2. Email is “rolled up” unintentionally. Previous replies becomes a “critical” piece of information otherwise you lose reply notifications on active topics.

The fix though is fairly complicated, so I just wanted to log this here to explain what it is I am fixing.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [Janeiro 25, 2016, 5:50am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422/2 "2016-01-25T05:50:03Z")

</div>

Thank you @sam I’ve seen this too, but didn’t know enough about what other users were doing to create such a detailed report.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [Janeiro 25, 2016, 7:26am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422/3 "2016-01-25T07:26:34Z")

</div>

> [@sam](#):
>
> On account B reply to topic twice.

So the repro is for the same person to post twice in the same topic? Seems a bit edge-casey if so.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Janeiro 25, 2016, 7:38am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422/4 "2016-01-25T07:38:48Z")

</div>

No … any 2 people, when you see

“◀ N replies” in your notifications this condition is hit. Can be any 2 different people.

Examples of this condition are here:

 ![](https://global.discourse-cdn.com/meta/original/3X/a/c/acfee9684e6fbb75f85c99dc4131e323e8a5d0f8.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Janeiro 27, 2016, 1:24am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422/5 "2016-01-27T01:24:17Z")

</div>

Fixed per:

[https://github.com/discourse/discourse/commit/1bb485fca50c7c235ea307f5b51bb0366f80317b](https://github.com/discourse/discourse/commit/1bb485fca50c7c235ea307f5b51bb0366f80317b)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [Janeiro 27, 2016, 1:24am UTC](https://meta.discourse.org/t/email-notifications-get-skipped-on-busy-topics/38422/6 "2016-01-27T01:24:25Z")

</div>


