From c8f5adc96e3a8bc5a635f8e3a8cc7704be6ffb44 Mon Sep 17 00:00:00 2001
From: felinae98 <731499577@qq.com>
Date: Wed, 30 Jun 2021 09:15:07 +0800
Subject: [PATCH] fix emergency bug

---
 src/plugins/nonebot_hk_reporter/platform/platform.py | 1 +
 tests/platforms/test_platform.py                     | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/plugins/nonebot_hk_reporter/platform/platform.py b/src/plugins/nonebot_hk_reporter/platform/platform.py
index b1ecf12..bc2e777 100644
--- a/src/plugins/nonebot_hk_reporter/platform/platform.py
+++ b/src/plugins/nonebot_hk_reporter/platform/platform.py
@@ -168,6 +168,7 @@ class NewMessageProcessMixin(StorageMixinProto, MessageProcessMixin, abstract=Tr
                 if post_id in store.exists_posts:
                     continue
                 res.append(raw_post)
+                store.exists_posts.add(post_id)
         self.set_stored_data(target, store)
         return res
 
diff --git a/tests/platforms/test_platform.py b/tests/platforms/test_platform.py
index c6c42b0..468eb6d 100644
--- a/tests/platforms/test_platform.py
+++ b/tests/platforms/test_platform.py
@@ -276,6 +276,8 @@ async def test_new_message_no_target(mock_platform_no_target, user_info_factory)
     assert('p2' in id_set_1 and 'p3' in id_set_1)
     assert('p2' in id_set_2)
     assert('p2' in id_set_3)
+    res3 = await mock_platform_no_target.fetch_new_post('dummy', [user_info_factory(lambda _: [1,2], lambda _: [])])
+    assert(len(res3) == 0)
 
 @pytest.mark.asyncio
 async def test_status_change(mock_status_change, user_info_factory):