# 在不刷新页面的情况下更改标签名称后再还原时出现404错误

**URL:** <https://meta.discourse.org/t/404-error-when-you-revert-a-tag-name-after-changing-it-without-reloading-the-page/342559>\
**Category:** Bug\
**Tags:** tags\
**Created:** [2024 年12 月 15 日 19:49 UTC](https://meta.discourse.org/t/404-error-when-you-revert-a-tag-name-after-changing-it-without-reloading-the-page/342559 "2024-12-15T19:49:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
发布日期： [2024 年12 月 15 日 19:49 UTC](https://meta.discourse.org/t/404-error-when-you-revert-a-tag-name-after-changing-it-without-reloading-the-page/342559/1 "2024-12-15T19:49:48Z")

</div>

这是一个非常小的 bug，算是一个边缘情况，但遇到 404 错误总归是不愉快的，因为它会在管理网站时触发“是不是我做错了什么？”的疑问。

在同一个屏幕上更改标签名称并将其恢复到之前的标签名称选择（意味着无需重新加载页面）会导致 404 错误。

![tag 404)](https://global.discourse-cdn.com/meta/original/4X/9/0/f/90fe7a1f07e96d1e121516d596b5facac0fd24ce.gif)

![tag 404](https://global.discourse-cdn.com/meta/original/4X/d/c/e/dce5296f79aa6f709585757e189ea66366cf2879.gif)

如果您至少更改一次标签名称，然后选择 **之前在同一屏幕上验证过的任何标签名称** （或原始名称），Discourse 会请求一个错误的 `/tag/<tag_name>/notifications` 路由，该路由使用了一个未使用的 `tag_name`，从而导致 404 错误。

重现步骤：

1. 打开一个现有的标签页：`https://your-discourse.com/tag/a`

2. 点击扳手图标，更改名称并验证 ✅

3. （可选）再次更改名称

4. 将名称恢复为之前的名称之一（或原始标签名称）

5. 4️⃣ 0️⃣ 4️⃣

---

_[View the full topic](https://meta.discourse.org/t/404-error-when-you-revert-a-tag-name-after-changing-it-without-reloading-the-page/342559)._
