# 聊天频道和聊天导航似乎已损坏

**URL:** <https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115>\
**Category:** Support\
**Created:** [2022年一月7日 04:23 UTC](https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115 "2022-01-07T04:23:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)\
**Post date:** [2022年一月7日 04:23 UTC](https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115/1 "2022-01-07T04:23:11Z")

</div>

我刚刚将 #chat-plugin 更新到了最新的提交 `76ff2ba`，我注意到了一些错误，导致它几乎无法使用。另外：我不记得实例上之前的插件提交状态是什么，也不知道如何查找——有人知道如何查找吗？

我看到的错误至少有：

1. 停靠的频道列表显示为空
  - 它会回到显示零个频道和默认文本：“您还没有加入任何频道。单击此处查看可用频道。”
  - 当我单击链接查看可用频道时，它不显示任何内容，并导航整个页面显示“服务器错误\n尝试加载 /chat/chat\_channels/all.json 时出错\n错误代码：500 错误”
  - 但是，当我单击铅笔图标并尝试创建具有类别或先前名称的新频道时，它会拒绝，并显示：“您向请求提供了无效参数：此类别和名称的频道已存在”

2. 单击全屏图标会导航到一个仅显示加载旋转图标的页面。
3. 个人聊天列表为空
  - 我能够添加之前与之聊过的人，并且聊天显示正常，我也能够发送消息。
  - `in_reply_to` 消息在新消息中不显示，但显示在旧消息中，所以我不知道是否有任何更改，但我自定义了回复消息，所以这可能是我的问题。

4. 从个人聊天停靠消息返回的按钮单击时不起作用，而以前单击它可以返回聊天列表。

如果您需要，我可以尝试查找错误日志并在此处发布或发送到其他地方。我尝试过在安全模式下运行，并关闭了主题，但这似乎没有解决任何问题。

编辑：  
我在浏览器控制台中看到的错误日志：

1. 

```plaintext
Failed to load resource: the server responded with a status of 500 () - /chat/chat_channels.json:1

```

2. 

```plaintext
Uncaught 
Object
errorThrown: ""
jqXHR: {readyState: 4, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}
textStatus: "error"
[[Prototype]]: Object
at _vendor-f78d12cebd7a573d3ed1aee5e766ee89.js:2177

```

与此同时，我将尝试将插件回滚到之前的提交，也许是大约 15 次提交之前，看看是否有效。我不知道是否有简单的方法可以做到这一点，现在，我将尝试这里的解决方法：

> [@Checkout specific version of plugin?](https://meta.discourse.org/t/checkout-specific-version-of-plugin/167919/4?u=jimkleiber):
>
> Okay, @Falco 's solution worked, but I had to go about it in a round about way. I forked the original repo Cloned it locally on my dev machine Created my branch from the desired commit git branch foo ec64ae8 Pushed that branch to my github git push -u origin foo Updated my app.yml with git clone -b foo git@github.com:my-repo.git Seems like there should be an easier way, but this gets the job done. Thanks for the direction @Falco !

---

<div class="post-metadata">

**Author:** ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)\
**Post date:** [2022年一月7日 19:38 UTC](https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115/2 "2022-01-07T19:38:03Z")

</div>

好的，在 @markvanlan、@sam、@j.jaffeux 和 @REALITY 的帮助下，我在聊天中解决了这个问题：

**摘要**  
我的网站上仍然安装了 topic list previews 插件，尽管它没有启用，但它在服务器端造成了问题。

我从 app.yml 文件中删除了它并进行了重建，它又可以正常工作了。

然后根据这个链接将其添加为主题组件：

> [@Chat channels and chat nav seem to have broken](https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115/3?u=jimkleiber):
>
> Topic List Previews plugin was deprecated in November 2021 and is now [a Theme Component](https://meta.discourse.org/t/topic-list-previews-theme-component/209973)

感谢大家的帮助！

**详情**  
（通过在浏览器中实例的基础 URL 后面附加 /logs 找到）

`StandardError (Attempted to access the non preloaded custom field 'topic_list_tiles'. This is disallowed to prevent N+1 queries.) app/models/concerns/has_custom_fields.rb:173:in ` ’ (eval):35:in `_fa`

```plaintext
app/models/concerns/has_custom_fields.rb:173:in `[]'
plugins/discourse-topic-previews/plugin.rb:78:in `block (3 levels) in activate!'
(eval):35:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:456:in `attributes'
plugins/discourse-custom-wizard/extensions/custom_field/serializer.rb:4:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in `as_json'
plugins/discourse-chat/app/serializers/chat_channel_serializer.rb:38:in `chatable'
(eval):4:in `_fast_attributes'

```

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [2022年一月7日 19:43 UTC](https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115/3 "2022-01-07T19:43:56Z")

</div>

Topic List Previews 插件已于 2021 年 11 月弃用，现已成为 [主题组件](https://meta.discourse.org/t/topic-list-previews-theme-component/209973)

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2022年二月6日 19:44 UTC](https://meta.discourse.org/t/chat-channels-and-chat-nav-seem-to-have-broken/214115/4 "2022-02-06T19:44:55Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
