Duplicate digests still

AI-generated summary

In a discussion regarding duplicate digests, brianlcheek reported that 14 users received duplicate emails shortly after enabling digests, despite previous reports of the bug being fixed. zogstrip suggested checking for stuck Sidekiq jobs or sent email logs. brianlcheek confirmed that user profiles showed correct timestamps with no obvious anomalies across the affected accounts.

zogstrip explained the root cause: the bug prevented the last_emailed_at column from updating during the 6-hour digest cycle, which was visible in logs as lines with empty usernames. The fix involved updating the code to properly record the timestamp and running a migration to correct historical records. zogstrip noted that the system should return to normal after the next job run. brianlcheek acknowledged the explanation, noting that while they hadn’t seen the blank log lines previously, the last_emailed_at fields on the affected accounts are now correct, suggesting the issue is resolved.

Continuing the discussion from After rebuild: lost email association + digest spam every 6 hours:

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?

Maybe the jobs were stuck in sidekiq?

What do you see in the sent email logs?

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.

1 me gusta

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

What are you basing that on?

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?

1 me gusta

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.