# 一些用户档案现在在更新后每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:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![HexaCubist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hexacubist/32/388556_2.png) [@HexaCubist](https://meta.discourse.org/u/HexaCubist)\
**Post date:** [2024年五月26日 20:48 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/1 "2024-05-26T20:48:18Z")

</div>

在更新到最新版本的 Discourse 后，一些用户开始每 30 分钟到一小时收到一封电子邮件：

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/d/3/5d37010b943f71490fcf35ffa212bea8e5c19bbb.png)

查看用户设置，它们似乎已更改为每 30 分钟或一小时发送一次电子邮件。我确信至少有一位用户没有自己进行此更改。并非所有用户的此设置都已更改。有人知道这是怎么回事吗？

Discourse 版本：3.3.0.beta3-dev

---

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [2024年五月26日 22:54 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/3 "2024-05-26T22:54:51Z")

</div>

有两位用户遇到了这个问题（至少抱怨的用户是这么多）。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2024年五月26日 23:01 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/4 "2024-05-26T23:01:04Z")

</div>

几周前，有用户抱怨收到了非常旧帖子的摘要，并且在上次发布后不久的一次升级似乎解决了这个问题。

也许值得分享一下你确切的提交。

---

<div class="post-metadata">

**Author:** ![HexaCubist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hexacubist/32/388556_2.png) [@HexaCubist](https://meta.discourse.org/u/HexaCubist)\
**Post date:** [2024年五月26日 23:32 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/5 "2024-05-26T23:32:24Z")

</div>

我查看了最近发送邮件的用户，也发现了同样的情况。有两名用户的设置已更新为每小时。看起来是两个相当活跃的用户？

@pfaffman 我当前所在的提交是 [581dbca97f](https://github.com/discourse/discourse/commits/581dbca97f2b55c9bbbe40dc3b58a9df7409d77f)

---

<div class="post-metadata">

**Author:** ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)\
**Post date:** [2024年五月27日 00:24 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/6 "2024-05-27T00:24:34Z")

</div>

他们不是最活跃的用户，我想他们一定是因为只有他们两个人而更改了设置。

此后，我已更新至 3.3.0.beta3-dev ([0e9451e93f](https://github.com/discourse/discourse/commits/0e9451e93ff930a1d367e75c9a027387d5c8fa81))，并且没有人抱怨。我不确定我之前的版本是什么。

---

<div class="post-metadata">

**Author:** ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)\
**Post date:** [2024年五月27日 02:52 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/7 "2024-05-27T02:52:50Z")

</div>

是的，我好像记得在大约上周引入了一个 bug，现在已经修复了。

啊，是的

> <https://github.com/discourse/discourse/pull/27035>
>
> instead of "last emailed" so that people getting email notifications (from a wat…ched topic for example) also get the activity summaries.
> 
> Context - https://meta.discourse.org/t/activity-summary-not-sent-if-other-emails-are-sent/293040
> 
> Internal Ref - t/125582
> 
> Improvement over https://github.com/discourse/discourse/commit/95885645d92cc84e69cb9ecffeaec8f69fe8d286

---

<div class="post-metadata">

**Author:** ![HexaCubist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hexacubist/32/388556_2.png) [@HexaCubist](https://meta.discourse.org/u/HexaCubist)\
**Post date:** [2024年五月27日 03:23 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/8 "2024-05-27T03:23:06Z")

</div>

很有趣！那么我的理解是，这些用户可能_确实_启用了每小时邮件通知，但之前的设置意味着他们只有在有新内容可分享时才会收到摘要。

随着这项更改，用户现在会在摘要周期收到邮件，即使论坛内容没有变化，并且在他们访问网站后将停止接收邮件。例如，如果帖子是在夜间发布的，并且您启用了每小时摘要，那么您将每小时收到一封邮件，直到您醒来并查看您的通知。

不确定我的感受如何，但这绝对合乎逻辑！如果说您只收到每周摘要，那会更有意义。如果能有配置此功能的能力就好了——对我们的网站来说，如果我们能减少重复的邮件噪音，那将是最好的。

---

<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日 07:46 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/11 "2024-05-27T07:46:04Z")

</div>

我会看看 🤔

如果我们没有为用户选择的 找到任何新内容，就不应该发送任何电子邮件摘要，即使频率是荒谬的“每 30 分钟”或“每小时”。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2024年五月27日 10:12 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/13 "2024-05-27T10:12:06Z")

</div>

这很复杂，因为人们仅通过电子邮件使用 discourse 的网站不关心他们从未“看到”过的、两年前的消息，因为他们从不登录。因此，对他们来说，帖子应该在发送给他们（或者可能是在摘要中发送？）时被视为“已读”。

---

<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日 13:10 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/14 "2024-05-27T13:10:09Z")

</div>

> [@pfaffman](#):
>
> 所以对他们来说，帖子应该被“看到”，如果它已经被发送给他们（或者也许是 **在摘要中发送了？** ）

我加粗的，是的，对于那些只通过电子邮件使用 Discourse 的人来说，它确实应该基于我们上次发送摘要的时间。

---

<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

---

<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:** [2024年六月2日 22:00 UTC](https://meta.discourse.org/t/some-user-profiles-now-email-summaries-every-30-minutes-after-update/309485/17 "2024-06-02T22:00:00Z")

</div>

此主题已在 5 天后自动关闭。不再允许回复。
