# Chat Plugin Bugs: page\_size ignored for past messages & emoji rendering issue

**URL:** https://meta.discourse.org/t/chat-plugin-bugs-page-size-ignored-for-past-messages-emoji-rendering-issue/376424
**Category:** Support
**Tags:** chat
**Created:** [July 29, 2025, 2:20pm UTC](https://meta.discourse.org/t/chat-plugin-bugs-page-size-ignored-for-past-messages-emoji-rendering-issue/376424 "2025-07-29T14:20:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nima1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nima1/32/299628_2.png) [@Nima1](https://meta.discourse.org/u/Nima1)
#### Post date: [July 29, 2025, 2:20pm UTC](https://meta.discourse.org/t/chat-plugin-bugs-page-size-ignored-for-past-messages-emoji-rendering-issue/376424/1 "2025-07-29T14:20:02Z")

</div>

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:**

1. Go to a chat channel.

2. Create a new thread or reply to an existing one.

3. Send a message that contains an emoji (e.g., “Hello world 👋”).

4. 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!

---

<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: [July 29, 2025, 11:18pm UTC](https://meta.discourse.org/t/chat-plugin-bugs-page-size-ignored-for-past-messages-emoji-rendering-issue/376424/2 "2025-07-29T23:18:39Z")

</div>

Do you mind opening 1 bug per bug, this makes it particularly hard to triage and handle… Moving to support for now.

Feel free to open 2 separate bug topics.

---

<div class="post-metadata">

### Author: ![Nima1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nima1/32/299628_2.png) [@Nima1](https://meta.discourse.org/u/Nima1)
#### Post date: [August 2, 2025, 9:52am UTC](https://meta.discourse.org/t/chat-plugin-bugs-page-size-ignored-for-past-messages-emoji-rendering-issue/376424/3 "2025-08-02T09:52:11Z")

</div>

> [@Chat UI: Emojis render as shortcodes in thread previews](https://meta.discourse.org/t/chat-ui-emojis-render-as-shortcodes-in-thread-previews/376985):
>
> I’d like to report a UI rendering bug in the Discourse Chat plugin. In the chat channel list, the preview for the latest message in a thread displays the raw emoji shortcode instead of the rendered emoji. Steps to Reproduce: Go to any chat channel. Create a new thread or reply to an existing one. Send a message that contains an emoji (e.g., “Hello world :shaking\_hands:”). Navigate back to the main chat view where all channels and threads are listed. Observe the message preview fo…

> [@Chat API: page\_size parameter is ignored when direction=past](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984):
>
> I’m reporting a bug with the Discourse Chat plugin’s API. When querying for past chat messages, the page\_size parameter is ignored, and the endpoint always returns the maximum number of messages. Steps to Reproduce: Make an API call to the chat messages endpoint (e.g., /chat/{channel\_id}/messages.json). Use the following parameters in the request: target\_message\_id: [ID of a recent message] direction: past page\_size: 5 (or any number less than 50) Expected Behavior: The API …

---

<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: [September 1, 2025, 9:52am UTC](https://meta.discourse.org/t/chat-plugin-bugs-page-size-ignored-for-past-messages-emoji-rendering-issue/376424/4 "2025-09-01T09:52:20Z")

</div>

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