fix emergency bug

This commit is contained in:
felinae98 2021-06-30 09:15:07 +08:00
parent 122e6875a5
commit c8f5adc96e
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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):