-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question: Duplicate data when use API channel.getPinnedMessages #2627
Comments
Give you my demo Step 1: clicking button page 1 (list next page of pinned messages) https://codesandbox.io/p/devbox/modest-hoover-hwgwky?file=%2Fsrc%2FApp.tsx%3A95%2C1 |
Hey @vihan85 , the duplication happens because of incorrect pagination parameter: Instead of taking the newest pinned message:
Take the last one:
You did not realize, that at the index 0, there is the oldest message as they are ordered in asc order. |
Hi @MartinCupela ,
|
Hey @vihan85 , by default, the pinned messages are sorted in ascending order as can be seen from the response in developer tools. What results are expected by you? |
So,
|
I will update the docs |
Describe the bug
Duplicate data when use API channel.getPinnedMessages
To Reproduce
https://miro.com/app/board/uXjVLlZ3HP0=/
Expected behavior
No duplicate data when get data in next page
Package version
stream-chat-react: ^12.6.0
stream-chat: "^8.40.9"
The text was updated successfully, but these errors were encountered: