# 删除主题中的其他帖子不应取消标记答案帖子

**URL:** <https://meta.discourse.org/t/delete-other-posts-in-a-topic-shouldnt-unanswer-the-answer-post/391717>\
**Category:** Bug\
**Tags:** solved, fixed\
**Created:** [2025年十二月19日 01:46 UTC](https://meta.discourse.org/t/delete-other-posts-in-a-topic-shouldnt-unanswer-the-answer-post/391717 "2025-12-19T01:46:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![small-lovely-cat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/small-lovely-cat/32/553546_2.png) [@small-lovely-cat](https://meta.discourse.org/u/small-lovely-cat)\
**Post date:** [2025年十二月19日 01:46 UTC](https://meta.discourse.org/t/delete-other-posts-in-a-topic-shouldnt-unanswer-the-answer-post/391717/1 "2025-12-19T01:46:24Z")

</div>

在 discourse-solved 插件中存在一个潜在的错误，当已回答主题中的任何帖子被删除时（触发 `post-destroyed`）， **无论被删除的帖子是否被标记为答案** ，已标记的答案都会变为未回答状态。

这看起来很奇怪，因为一旦有人删除了主题中不相关的帖子，主题所有者将不得不重新选择一个答案，否则他们会收到 discobot 的通知。

也许将该逻辑更改为：只有删除 **被标记为答案的帖子** 时，帖子才变为未回答状态，这可能是一个更合理的方法？

修复的拉取请求（PR）已在此处提出：

> <https://github.com/discourse/discourse/pull/36800>
>
> There exists a potential bug in discourse-solved plugin, when any of the post in… the answered topic is removed(trigger \`post-destroyed\`), \*\*whether the removed post in marked as the answer or not\*\*, the marked answer will be unanswered.
> 
> It seems weird because once someone removes an unrelated post in a topic, the topic owner will have to reselect an answer, or they will be notified by the discobot.
> 
> This commit fix this by adding a discrimination logic: only when the post marked as answer is removed will \`unanswer\` be triggered, and the removal of other posts won't do that.
> 
> Before:
> 
> https://github.com/user-attachments/assets/f67fff80-9c63-4762-a47b-4bf30894d4a4
> 
> After:
> 
> https://github.com/user-attachments/assets/1729c9f3-948d-45ed-a00e-8931b4ad2089

---

_[View the full topic](https://meta.discourse.org/t/delete-other-posts-in-a-topic-shouldnt-unanswer-the-answer-post/391717)._
