# 通过查看操作重新生成通知

**URL:** <https://meta.discourse.org/t/notifications-being-regenerated-by-looking-through-actions/156709>\
**Category:** Support\
**Created:** [2020 年7 月 3 日 16:37 UTC](https://meta.discourse.org/t/notifications-being-regenerated-by-looking-through-actions/156709 "2020-07-03T16:37:47Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
发布日期： [2020 年7 月 3 日 16:37 UTC](https://meta.discourse.org/t/notifications-being-regenerated-by-looking-through-actions/156709/1 "2020-07-03T16:37:47Z")

</div>

好的，这是一个关于旧版本的奇怪案例，但我希望有人能提供一些线索，或者可能有类似的经验。

我们有一个论坛（由于依赖自定义插件，版本停留在 2.4.5），用户抱怨收到重复的通知。有时，通知会在事件发生几天后重新生成，而且此时用户已经（在 Discourse 界面中，而非 App 或浏览器中）多次查看并点击过这些通知。

某主题的帖子记录：

```
 post_number | created_at         
-------------+----------------------------
           1 | 2020-06-22 17:06:42.531868
           2 | 2020-06-23 00:11:07.159579
           3 | 2020-06-24 00:35:06.000641
           4 | 2020-06-25 00:17:16.998622
           5 | 2020-06-29 00:00:39.712988
           6 | 2020-06-29 01:03:20.137653
           7 | 2020-06-29 01:32:45.604947

```

该用户针对该主题的通知记录：

```
   id | notification_type | user_id | created_at | topic_id | post_number 
---------+-------------------+---------+----------------------------+----------+-------------
 1125345 | 5 | 956 | 2020-06-24 21:45:21.521173 | 39247 | 3
 1133280 | 5 | 956 | 2020-06-29 01:27:32.242212 | 39247 | 6
 1140349 | 2 | 956 | 2020-07-02 21:11:44.843782 | 39247 | 7

```

如您所见，针对第 7 楼的回复通知是在回复发出 3.5 天之后才生成的。

当我们搜索访问日志以查明 21:11:44 发生了什么时，发现该用户正好在这一秒浏览其“个人资料 - 活动 - 回复”页面（`/user_actions.json?username=redacted&filter=5&offset=240`）。

这几乎像是_浏览这些回复导致了通知的重新生成_。

相关的插件是 onesignal 和 push-notifications。

有人有任何想法吗？

编辑：一天后，第 7 楼的通知再次被重新生成：

```
   id | notification_type | user_id | created_at | topic_id | post_number 
---------+-------------------+---------+----------------------------+----------+-------------
 1125345 | 5 | 956 | 2020-06-24 21:45:21.521173 | 39247 | 3
 1133280 | 5 | 956 | 2020-06-29 01:27:32.242212 | 39247 | 6
 1141684 | 2 | 956 | 2020-07-04 02:23:12.188685 | 39247 | 7

```

---

_[View the full topic](https://meta.discourse.org/t/notifications-being-regenerated-by-looking-through-actions/156709)._
