# 同一类别中同一标签的权限不一致

**URL:** https://meta.discourse.org/t/inconsistent-permission-to-use-the-same-tag-in-the-same-category/400696
**Category:** Bug
**Tags:** composer, tags
**Created:** [2026年四月15日 13:27 UTC](https://meta.discourse.org/t/inconsistent-permission-to-use-the-same-tag-in-the-same-category/400696 "2026-04-15T13:27:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2026年四月15日 13:27 UTC](https://meta.discourse.org/t/inconsistent-permission-to-use-the-same-tag-in-the-same-category/400696/1 "2026-04-15T13:27:37Z")

</div>

我对这个新功能有些困惑，它解释了为什么我不能使用某些标签。根据搜索词的不同，有时系统提示我可以在该类别中使用该标签，有时又说不可以。如果我不被允许在该类别中使用该标签，那这种限制难道不应该是一致的吗？不过，我认为我应该在“支持”类别中使用主题组件标签，所以我不明白为什么自动补全功能会提示我不能使用。

 ![Screenshot20260415151839Firefox](https://global.discourse-cdn.com/meta/original/4X/0/7/a/07acb21805b6f2d71084b408d64b1befcf716e44.jpeg) ![Screenshot20260415151951Firefox](https://global.discourse-cdn.com/meta/original/4X/d/0/5/d05f3bfb10127e63392e4d3e465baaa988fd751c.jpeg)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年四月15日 20:31 UTC](https://meta.discourse.org/t/inconsistent-permission-to-use-the-same-tag-in-the-same-category/400696/4 "2026-04-15T20:31:07Z")

</div>

哈哈，我的错 🤦‍♂️ 该 [功能](https://github.com/discourse/discourse/pull/39072) 在 **限制** 方面需要稍微“聪明”一点 😉

> <https://github.com/discourse/discourse/pull/39300>
>
> When searching tags in the composer, \`filter\_allowed\_tags\` applies a LIMIT (\`max…\_tag\_search\_results\`, default 5). If more allowed tags match the query than fit under the limit, the overflow is silently dropped.
> 
> \`append\_disabled\_tags\` then ran a naive substring query for visible tags matching the term, assumed any tag not in the allowed list must be excluded by filter rules, and asked \`explain\_exclusion\` to fabricate a reason. Allowed-but-cut-off tags leaked into the disabled list and showed the vague fallback "\\"X\\" cannot be used in this category".
> 
> Because \`filter\_allowed\_tags\` orders by term (\`DISTINCT ON (lower(name) = lower(term), ...)\`), the same tag could appear allowed under one search term (prefix match, ranks high, fits in the limit) and disabled under another (mid-string match, ranks lower, gets cut off) — producing inconsistent verdicts for the same tag in the same category.
> 
> Before labeling any tag as disabled or forbidden, re-run \`filter\_allowed\_tags\` scoped to the candidate names (no limit) and drop any that come back allowed. Extracted to \`reject\_allowed\_tags\` so both \`append\_disabled\_tags\` and \`detect\_forbidden\_tag\` go through the same verification. The probe is skipped when the allowed result didn't saturate its limit, since no cutoff is possible in that case.
> 
> https://meta.discourse.org/t/400696

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2026年四月16日 22:00 UTC](https://meta.discourse.org/t/inconsistent-permission-to-use-the-same-tag-in-the-same-category/400696/5 "2026-04-16T22:00:20Z")

</div>

此主题已在 21 小时后自动关闭。不再允许新的回复。
