stream-chat-swift
stream-chat-swift copied to clipboard
[Reactions v2] Add `reactionGroups` to `ChatMessage`
🔗 Issue Links
Relates to https://github.com/GetStream/ios-issues-tracking/issues/787
🎯 Goal
Adds reactionsGroups to ChatMessage so that reactions can be sorted by date.
📝 Summary
- Adds
reactionsGroupstoChatMessageso that reactions can be sorted by date. - Adds
firstReactionAtandlastReactionAtfrom reactionGroups inChatMessageReactionDataforComponents.reactionsSorting - Adds optimistic updates for the reactions group
- Fixes existing issues of optimistic updates
- Adds tests for optimistic updates
- Updates Slack example app to sort reactions in the message list by
firstReactionAt
🛠 Implementation
Adds reactionsGroups to ChatMessage which includes the reactionCounts, reactionScores and also the dates for the first reaction and last reaction of the type. The reactionCounts and reactionScores are still kept for backwards compability.
🧪 Manual Testing Notes
- Open Demo App
- React to messages
- The order of the reactions in the message list should be sorted by the date of the first reaction of that type and count (Like slack)
Note: Currently only working for new reactions.
☑️ Contributor Checklist
- [x] I have signed the Stream CLA (required)
- [x] This change follows zero ⚠️ policy (required)
- [x] This change should be manually QAed
- [x] Changelog is updated with client-facing changes
- [x] New code is covered by unit tests
- [ ] Comparison screenshots added for visual changes
- [ ] Affected documentation updated (docusaurus, tutorial, CMS)
Btw, the slack app doesn't build, please check before merging
Quality Gate passed
Issues
64 New issues
0 Accepted issues
Measures
0 Security Hotspots
83.1% Coverage on New Code
0.0% Duplication on New Code