-
Notifications
You must be signed in to change notification settings - Fork 373
fix(llc): fix pinned message get duplicated #2252
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2252 +/- ##
==========================================
+ Coverage 63.17% 63.21% +0.03%
==========================================
Files 402 402
Lines 25229 25224 -5
==========================================
+ Hits 15939 15945 +6
+ Misses 9290 9279 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @VladShturma , Thank you for the PR. Can you fix the formatting issues and add additional tests for cases like: 1: When a already pinned message is updated (should not add duplicate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the duplicated pinned message issue by removing the redundant logic that added messages to pinnedMessages and adds a corresponding test to verify the fix.
- Removed the code that manually appended pinned messages in ChannelClientState.
- Added tests to ensure that a pinned message is only added once.
- Updated the CHANGELOG to reflect the bug fix.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/stream_chat/test/src/client/channel_test.dart | Added tests for the messageUpdated event to verify pinned behavior. |
| packages/stream_chat/lib/src/client/channel.dart | Removed duplicate logic that led to inherent message duplication. |
| packages/stream_chat/CHANGELOG.md | Updated the changelog with a note of the bug fix. |
9a9f366 to
75768f7
Compare
|
Hello @xsahil03x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @VladShturma LGTM, just added one comment
75768f7 to
efbc7ba
Compare
|
Hey @xsahil03x done |
Github Issue: #2013
CLA
Description of the pull request
If you pin message,
channel.state.pinnedMessagesstarts to store message twice. There already was a fix for such an issue, but for some reason it was overwritten later. I reapplied it and also added test