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

[Reactions v2] Add `reactionGroups` to `ChatMessage`

Open nuno-vieira opened this issue 1 year ago • 3 comments

🔗 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 reactionsGroups to ChatMessage so that reactions can be sorted by date.
  • Adds firstReactionAt and lastReactionAt from reactionGroups in ChatMessageReactionData for Components.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

  1. Open Demo App
  2. React to messages
  3. 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)

nuno-vieira avatar Apr 19 '24 14:04 nuno-vieira

1 Warning
:warning: Big PR

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Apr 19 '24 14:04 github-actions[bot]

Btw, the slack app doesn't build, please check before merging

martinmitrevski avatar Apr 23 '24 22:04 martinmitrevski