Chat replies missing excerpt

I recently rebuilt my self-hosted discourse and I see now that all chat replies lost the excerpt text. The reply-to avatar is still visible though and the href id is correct and clicking takes you to the correct post.

Making a new reply shows the excerpt after posting, but if you close the chat it disappears like the others.

3.3.0.beta2-dev (f7a1272fa4)

(I have no related plugins or modifications to interfere AFAIK)

Screenshot 2024-04-29 at 3.08.31 PM

         {
            "id": 1892,
            "message": "testing reply",
            "cooked": "\u003cp\u003etesting reply\u003c/p\u003e",
            "created_at": "2024-04-29T19:02:11Z",
            "excerpt": "testing reply",
            "chat_channel_id": 2,
            "streaming": false,
            "user": {...},
            "mentioned_users": [],
            "available_flags": [],
            "chat_webhook_event": null,
            "in_reply_to": {
                "id": 1880,
                "cooked": "\u003cp\u003eearn teh powahz\u003c/p\u003e",
                "excerpt": null,
                "user": {...},
                "chat_webhook_event": null
            },
            "uploads": []
        },
2 Likes

My dev instance is a week older on 3.3.0.beta2-dev (a564274ba2) and doesn’t have this problem. So my guess is it has something to do with this PERF: Reduce overhead from chat message excerpt by dbattersby · Pull Request #26712 · discourse/discourse · GitHub or this FIX: build chat message excerpt for thread preview by dbattersby · Pull Request #26765 · discourse/discourse · GitHub

1 Like

In my case of only ~1000 chat messages, it was simple to just update them all to add the excerpt:

Chat::Message.where(excerpt: nil).each{|m| m.update(excerpt: m.build_excerpt) };0

But a code fix would be to add a fallback to plugins/chat/app/serializers/chat/in_reply_to_serializer.rb

def excerpt
  object.excerpt || object.build_excerpt
end
1 Like

Thank you for reporting. I have been able to repro this issue, I will look into this and share a fix soon.

2 Likes

This should be fixed with this commit:

3 Likes

This topic was automatically closed after 3 days. New replies are no longer allowed.