# 删除主题时会出现加载循环

**URL:** <https://meta.discourse.org/t/a-loading-loop-will-occur-when-user-try-to-fetch-the-former-latter-page-of-a-removed-topic/385665>\
**Category:** Bug\
**Created:** [2025年十月15日 08:33 UTC](https://meta.discourse.org/t/a-loading-loop-will-occur-when-user-try-to-fetch-the-former-latter-page-of-a-removed-topic/385665 "2025-10-15T08:33:36Z")\
**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年十月15日 08:33 UTC](https://meta.discourse.org/t/a-loading-loop-will-occur-when-user-try-to-fetch-the-former-latter-page-of-a-removed-topic/385665/1 "2025-10-15T08:33:36Z")

</div>

> <https://github.com/discourse/discourse/pull/35409>
>
> For these steps:
> 1. Login as a user, and read a topic;
> 2. The admin/moderator …removes the topic;
> 3. Go up/down and trigger the fetch of the former/latter page.
> 
> Then the page will stuck in an infinite loading, with the console showing \`403 forbidden\` getting \`/t/${this.topic.id}/posts.json\`. And if the website is protected by a waf, then the user will be banned from visiting it.
> 
> This commit fix this by adding a callback to refresh the whole page when ajax returned 403, and then the user will see a 404 page.
> 
> \<img width="881" height="612" alt="image" src="https://github.com/user-attachments/assets/14e5db5b-cf6b-4b68-948c-44dd1de81450" /\>

对于以下步骤：

1. 以用户身份登录并阅读一个主题；
2. 管理员/版主删除该主题；
3. 上下滚动并触发加载前/后一页。

然后页面将卡在无限加载中，控制台显示 `403 forbidden` 并获取 `/t/${this.topic.id}/posts.json`。如果网站受到 WAF 保护，用户将被禁止访问。

---

_[View the full topic](https://meta.discourse.org/t/a-loading-loop-will-occur-when-user-try-to-fetch-the-former-latter-page-of-a-removed-topic/385665)._
