# 用户加入超过100个聊天时，星标聊天会消失

**URL:** <https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040>\
**Category:** Support\
**Tags:** chat\
**Created:** [2026年八月27日 07:51 UTC](https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040 "2026-08-27T07:51:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ARK-Helena](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@ARK-Helena](https://meta.discourse.org/u/ARK-Helena)\
**Post date:** [2026年八月27日 07:51 UTC](https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040/1 "2026-08-27T07:51:46Z")

</div>

当用户关注的公共频道超过 100 个时，已加星标的聊天频道会消失

关注了超过 100 个公共分类聊天频道的用户，在重新加载 Discourse 后无法可靠地看到所有已加星标的频道。

我验证了以下内容：

- /chat/api/me/channels 仅返回 100 个已关注的公共频道。
- 返回的频道按字母顺序排列。
- 位于前 100 个频道之外的频道未出现在侧边栏和“已加星标”部分中。
- 直接获取该频道确认其状态为开放，且 following=true 和 starred=true。
- 关注少于 100 个公共频道的用户能正常看到相同的已加星标频道。

后端在按字母顺序排列后应用了 MAX\_PUBLIC\_CHANNEL\_RESULTS = 100：

> <https://github.com/discourse/discourse/blob/13915be55032a5144f49bea79dfbdca5b4c99346/plugins/chat/lib/chat/channel_fetcher.rb>

前端似乎通过过滤已经截断的通用频道集合来派生 starredChannels：

> <https://github.com/discourse/discourse/blob/13915be55032a5144f49bea79dfbdca5b4c99346/plugins/chat/assets/javascripts/discourse/services/chat-channels-manager.js>

在引入字母顺序排列更改后，此问题变得一致且明显：

> <https://github.com/discourse/discourse/commit/4c7a4f637f6c6eecdd3fcf6a46a198dbd1ba994a>
>
> \* Sort channels by name
> \* Show channel emoji next to channel name if it exists
> \*… Add dropdown filter to filter by channel membership
> status (joined/not joined)
> 
> \<img width="1102" height="458" alt="image"
> src="https://github.com/user-attachments/assets/309490fc-abad-48a3-95e0-a037f7ea2f73"
> /\>

预期行为：无论其在公共频道结果中的位置如何，所有已加入和已加星标的频道都应显示在“已加星标”中。 可能的修复方案是独立加载已加星标的频道，或对所有已关注的公共频道进行分页处理。

---

<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年八月27日 08:37 UTC](https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040/3 "2026-08-27T08:37:23Z")

</div>

感谢报告 @ARK-Helena 👍 这个边界情况确实有点极端\[1\]，所以我把苹果“一分为二”，支持独立获取星标频道和普通频道，但每种“类型”仍然保留 100 个的上限。

> <https://github.com/discourse/discourse/pull/42975>
>
> Previously, \`Chat::ChannelFetcher.structured\` capped the sidebar payload at 100 …followed public channels (ordered alphabetically) and 75 direct message channels (ordered by activity), so a starred channel past either cutoff never reached the client and vanished from the Starred section.
> 
> This change fetches starred channels with a dedicated query and merges them into the result, running it only when the base list actually hit its limit so the extra queries cost nothing for the vast majority of users.
> 
> Meta: https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040

* * *

1. 说真的，100 个星标频道？

---

<div class="post-metadata">

**Author:** ![ARK-Helena](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@ARK-Helena](https://meta.discourse.org/u/ARK-Helena)\
**Post date:** [2026年八月27日 08:44 UTC](https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040/4 "2026-08-27T08:44:22Z")

</div>

哇 @zogstrip 那速度快得惊人 🙂 我想知道，如果用户加入了超过 100 个（任意类型的）聊天室，他们还能在侧边栏中加载所有聊天室吗？侧边栏是否有某种分页机制，或者至少有一个提示表明列表已被截断？非常感谢！🙂

---

<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年八月27日 08:47 UTC](https://meta.discourse.org/t/starred-chats-disappear-if-user-is-in-more-than-100-chats/411040/5 "2026-08-27T08:47:10Z")

</div>

> [@ARK-Helena](#):
>
> 我想知道，属于 100 个以上聊天室（无论哪种类型）的用户，是否仍然能够在侧边栏中加载所有聊天室？侧边栏是否有某种分页机制，或者至少有一个提示表明列表已被截断？非常感谢！🙂

没有，这就是我为什么说我把苹果切成两半的原因，因为添加分页机制会耗费更多的精力。而且，处于这种非常规状态的用户非常罕见，所以在投入精力去实现之前，我们必须等待更多的[“用户报告”](https://blog.codinghorror.com/rule-of-three/)。
