Skip to content
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

[CIS-1131] Support marking all channels as read at a user level #1927

Merged
merged 9 commits into from Apr 14, 2022

Conversation

adolfogarza
Copy link
Contributor

@adolfogarza adolfogarza commented Apr 13, 2022

🔗 Issue Link

CIS-1131

🎯 Goal

The goal is to relocate markAllRead() from the ChannelListController to CurrentUserController to have parity with other platforms.

🛠 Implementation

The markAllRead() call has been relocated to CurrentUserController, the specific implementation has been moved to CurrentUserUpdater to be consistent with the current architecture. Tests have been included to cover typical use cases. The current markAllRead() has been marked as deprecated in order to not disturb current implementors of that call, but let them know that there is a better way to do that now

📝 Changes

_ N/A

🎨 UI Changes

N/A

Before After
img img

🧪 Testing

Since this method not used in the demo app or in the UI SDK by default, a very simple way to test this is to generate new messages on multiple channels that your user belongs to, then call ChatClient.shared.currentUserController().markAllRead() on DemoChannelListVC at viewDidLoad and you should be able to see how these are marked as read.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • This change follows zero ⚠️ policy (required)
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

@adolfogarza adolfogarza requested a review from a team as a code owner April 13, 2022 17:45
@adolfogarza adolfogarza changed the title Support 'mark all read' at a user level [CIS-1131] Support 'mark all read' at a user level Apr 13, 2022
@adolfogarza adolfogarza changed the title [CIS-1131] Support 'mark all read' at a user level [CIS-1131] Support marking all channels as read at a user level Apr 13, 2022
@emerge-tools
Copy link

emerge-tools bot commented Apr 13, 2022

🚨 This change increases app size by 2.5 kB

Image of diff

🗂 See the Emerge breakdown
Item Size change
StreamChat.framework/StreamChat.Controller.callback 1.1 kB
➕ StreamChat.framework/StreamChat.CurrentUserUpdater.markAllRead(completion) 616 B

🔎 See the full analysis (85a6a11) merging into develop (09114ea)

Provide a base_sha with your upload to ensure diffs are correct. Read more in the docs

Copy link
Contributor

@evsaev evsaev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done @adolfogarza 👍 Let's check with @bielikb @alteral that GIVEN/WHEN/THEN were supposed to be used not only in UI tests. Once it's resolved, I'll approve 🙂

@adolfogarza adolfogarza requested a review from evsaev April 14, 2022 14:02
Copy link
Contributor

@evsaev evsaev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@sonarcloud
Copy link

sonarcloud bot commented Apr 14, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.4% 88.4% Coverage
0.0% 0.0% Duplication

@adolfogarza adolfogarza merged commit 7824eae into develop Apr 14, 2022
@adolfogarza adolfogarza deleted the feature/CIS-1131 branch April 14, 2022 18:09
This was referenced Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants