-
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
bug: channel list not updated after pinning a channel #2595
Comments
Hey, @michalvankodev, thank you for submitting this issue. The problem is in the sort object - when pulling data from database you sort by keys, the order of the keys is important. That being said - our SDK allows passing const sort: ChannelSort = [
{ pinned_at: -1 },
{ last_updated_at: -1 },
{ last_message_at: -1 },
]; |
Thanks @arnautov-anton. This has resolved the issue. It would be worth mentioning this in the documentation instead of the examples provided. |
Definitely, it's on our list to add this limitation to the documentation. I'll also explore an option to allow such objects to be considered as well as it seems that |
### 🎯 Goal Adjust certain conditions to match behavior of the RN implementation, add missing handler for the `notification.added_to_channel`. #### Notable Changes - `notification.added_to_channel` is being handled properly (considers pinned channels) - if `sort` is an object and `pinned_at` is first in chronological order of property creation `{ pinned_at: 1 | -1 }` then pinned channels are considered (#2595 (comment)) Related PR: GetStream/stream-chat-js#1430
## [12.9.0](v12.8.2...v12.9.0) (2025-01-27) ### Bug Fixes * channel-pinning related improvements ([#2602](#2602)) ([9f41a4c](9f41a4c)), closes [/github.com//issues/2595#issuecomment-2569118691](https://github.com/GetStream//github.com/GetStream/stream-chat-react/issues/2595/issues/issuecomment-2569118691) * import execSync ([#2616](#2616)) ([3801375](3801375)) ### Features * add prop disabled to ChatAutoComplete props ([#2617](#2617)) ([8b686fe](8b686fe))
Describe the bug
After pinning a channel the channel list is not re-sorted and it doesn't show newly pinned channel within the group of other pinned channels.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Channel list should be sorted according to the sort rules passed and should be updated when channel is updated
Screenshots
Best friends group
is pinned but it was not attached to the group of pinned channelsPackage version
If I should apply sorting manually is there a way how to just force update?
The text was updated successfully, but these errors were encountered: