# Chat API: parâmetro page\_size é ignorado quando direction=past

**URL:** https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984
**Category:** Bug
**Tags:** chat, rest-api
**Created:** [2 Agosto , 2025 09:50 UTC](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984 "2025-08-02T09:50:52Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![loic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/loic/32/105621_2.png) [@loic](https://meta.discourse.org/u/loic)
#### Post date: [7 Agosto , 2025 16:33 UTC](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984/5 "2025-08-07T16:33:31Z")

</div>

Encontrei o bug! Eu já estava refatorando esse serviço um pouco, então incluí a correção nele:

> <https://github.com/discourse/discourse/pull/33380>
>
> \- Introduce a \`max\_page\_size\` option, allowing different behavior between contro…llers and SDK.
> \- Improve the contract (validations & helper method).
> \- Use \`model\` where possible.
> \- Extract message existence logic to a dedicated policy, allowing easier testing.
> \- Refactor specs to follow current guidelines/best practices.

---

_[View the full topic](https://meta.discourse.org/t/chat-api-page-size-parameter-is-ignored-when-direction-past/376984)._
