# 一些用户档案现在在更新后每30分钟通过电子邮件发送摘要

**URL:** <https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485>\
**Category:** Bug\
**Tags:** activity-summary, fixed\
**Created:** [2024年五月26日 20:48 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485 "2024-05-26T20:48:17Z")\
**Posts on this page:** 1\
**Showing post:** 15

<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:** [2024年五月27日 15:38 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/15 "2024-05-27T15:38:04Z")

</div>

我们计算电子邮件摘要内容所使用的“窗口”存在问题:man\_facepalming:  
该问题将通过 👇 修复

> <https://github.com/discourse/discourse/pull/27206>
>
> In https://github.com/discourse/discourse/commit/958437e7ddce6e015725522d25c3f83…27ff4064a we ensured that the email summaries are properly sent based on 'digest\_attempted\_at' for people who barely/never visit the forum.
> 
> This fixed the "frequency" of the email summaries but introduced a bug where the digest would be sent even though there wasn't anything new since for some users.
> 
> The logic we use to compute the threshold date for the content to be included in the digest was
> 
> \`\`\`ruby
> @since = opts\[:since\] || user.last\_seen\_at || user.user\_stat&.digest\_attempted\_at || 1.month.ago
> \`\`\`
> 
> It was working as expected for users who were never seen but for users who had connected at least once, we would use their "last\_seen\_at" date as the "threshold date" for the content to be sent in a summary 😬
> 
> This fix changes the logic to be the most recent date amongst the \`last\_seen\_at\`, \`digest\_attempted\_at\` and \`1.month.ago\` so it's correctly handling cases where
> 
> \- user has never been seen nor emailed a summary (capped at 1 month)
> \- user has been seen in a while but has recently been sent a summary
> \- user has been sent a summary recently but hasn't been seen in a while
> 
> Context - https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485

---

_[View the full topic](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485)._
