stream-chat-react icon indicating copy to clipboard operation
stream-chat-react copied to clipboard

bug: The “latest message” button doesn’t scroll to the correct position.

Open vihan85 opened this issue 4 months ago • 4 comments

Describe the bug

A clear and concise description of what the bug is.

To Reproduce I set the messages_limit to load 25 messages at a time.

Currently, my channel has 100 messages. I replied to the very first message, then reloaded the page.

After reloading, when I click on the message I replied to, a button appears that allows me to jump back to the latest message. However, when I click that button, it doesn’t always scroll correctly to the latest message — after repeating this action a few times, the scroll position becomes inaccurate.

Please show me how to fix this. I want it to instantly scroll to the latest message when I click the button.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

https://drive.google.com/drive/folders/1qYArL6WbITStdY86bjmnvA_7K5k64MvB

Package version "@stream-io/stream-chat-css": "^5.14.0", "stream-chat-react": "^13.9.0", "stream-chat": "^9.222.1"

vihan85 avatar Oct 15 '25 09:10 vihan85

Hello @vihan85 , what I observe is a slight delay in scroll, when the position becomes inaccurate. I am taking a look.

MartinCupela avatar Oct 15 '25 13:10 MartinCupela

The reason for the delay is that we debounce propagation of the target message page.

This is in order to prevent race conditions as described in the PR #2242.

We plan to do a refactor of the Channel component that would consist in having reactive state in the Channel instance instead of the component. Once that is done, this issue should also be solved.

MartinCupela avatar Oct 15 '25 14:10 MartinCupela

Hi @MartinCupela

Can I know when the Channel component refactor is planned?

vihan85 avatar Oct 16 '25 03:10 vihan85

I cannot share any ETA at the moment.

MartinCupela avatar Oct 16 '25 07:10 MartinCupela