# Duplicate digests still

**URL:** https://meta.discourse.org/t/duplicate-digests-still/38996
**Category:** Bug
**Tags:** activity-summary
**Created:** [February 3, 2016, 9:37pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996 "2016-02-03T21:37:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![brianlcheek](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@brianlcheek](https://meta.discourse.org/u/brianlcheek)
#### Post date: [February 3, 2016, 9:37pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/1 "2016-02-03T21:37:49Z")

</div>

Continuing the discussion from [After rebuild: lost email association + digest spam every 6 hours](https://meta.discourse.org/t/after-rebuild-lost-email-association-digest-spam-every-6-hours/38841/3):

disabled digests for all users after 14 got duplicates the last several days. Found threads (including this one) that the bug had been fixed, upgraded to the latest commit this morning…enabled digests and this afternoon those same 14 users got another digest!

Did I miss something?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 3, 2016, 9:40pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/2 "2016-02-03T21:40:12Z")

</div>

> [@brianlcheek](#):
>
> Did I miss something?

Maybe the jobs were stuck in sidekiq?

What do you see in the sent email logs?

---

<div class="post-metadata">

### Author: ![brianlcheek](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@brianlcheek](https://meta.discourse.org/u/brianlcheek)
#### Post date: [February 3, 2016, 9:45pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/3 "2016-02-03T21:45:03Z")

</div>

![](https://global.discourse-cdn.com/meta/original/3X/b/6/b67a756b325cde47e2b0134b973d962f56b53191.PNG)

User profiles show correct time for e-mails. Nothing seems to stand out for these 14, a few are test a few internal employees, the rest customers…created different times, different viewing habits, different vistis, etc.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 3, 2016, 9:46pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/4 "2016-02-03T21:46:52Z")

</div>

Seems like everything is back to normal. Digests should get back to their schedule.

---

<div class="post-metadata">

### Author: ![brianlcheek](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@brianlcheek](https://meta.discourse.org/u/brianlcheek)
#### Post date: [February 3, 2016, 9:47pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/5 "2016-02-03T21:47:58Z")

</div>

What are you basing that on?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 3, 2016, 9:55pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/6 "2016-02-03T21:55:30Z")

</div>

The bug was that whenever we sent a digest (every 6 hours), we were not updating the “`last_emailed_at`” column. You could see that in the sent emails logs because there were lines not associated to a user (_ie. username was empty_). I fixed the code so that it properly updates the “`last_emailed_at`” column **and** added a migration to fix these old records. You just need to wait for the next run of the Digest job to get everything back to normal.

Does that make sense?

---

<div class="post-metadata">

### Author: ![brianlcheek](https://avatars.discourse-cdn.com/v4/letter/b/2bfe46/32.png) [@brianlcheek](https://meta.discourse.org/u/brianlcheek)
#### Post date: [February 3, 2016, 10:00pm UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/7 "2016-02-03T22:00:28Z")

</div>

Yes, that helps thank you.

I don’t recall ever seeing any blank lines in the log though…maybe I just don’t remember.

Also, I didn’t check individual accounts before I upgraded (or before the digest went this last time) so I am hoping you are correct since those accounts do have a `"last_emailed_at"` that is correct now, that it is fixed.

---

<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: [February 4, 2016, 2:36am UTC](https://meta.discourse.org/t/duplicate-digests-still/38996/8 "2016-02-04T02:36:18Z")

</div>


