I’d like to report two separate bugs I’ve encountered with the Discourse Chat plugin.
1. API: page_size
is ignored when direction=past
When querying for chat messages via the API, the page_size
parameter does not work as expected when fetching older messages. It always returns the maximum of 50 items, regardless of the specified size.
Steps to Reproduce:
Make an API call to the chat messages endpoint with the following parameters:
-
target_message_id
: [ID of the last message you see] -
direction
:past
-
page_size
:5
(or any number less than 50)
Expected Behavior:
The API should return a JSON object containing a maximum of 5 messages that were sent before the target_message_id.
Actual Behavior:
The API returns 50 messages, ignoring the page_size=5 parameter. It seems to be hardcoded to the maximum page size in this specific scenario.
2. UI: Emojis render incorrectly in chat thread previews
In the chat channel list, the preview of the latest message in a thread does not render emojis correctly. Instead of displaying the graphical emoji, it shows the raw emoji shortcode.
Steps to Reproduce:
-
Go to a chat channel.
-
Create a new thread or reply to an existing one.
-
Send a message that contains an emoji (e.g., “Hello world
”).
-
Navigate back to the main chat view where all channels and threads are listed.
Expected Behavior:
The message preview for that thread should display the rendered emoji, like: “Hello world ”.
Actual Behavior:
The message preview shows the un-rendered text shortcode: “Hello world :shaking-hand:”.
Thanks for your great work on Discourse and for looking into these issues!