feat: localized unread count#1787
Merged
Merged
Conversation
Contributor
|
Size Change: +2.51 kB (+0.61%) Total Size: 412 kB 📦 View Changed
|
6 tasks
oliverlaz
reviewed
Jun 29, 2026
szuperaz
approved these changes
Jun 29, 2026
MartinCupela
approved these changes
Jul 3, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 3, 2026
## [9.50.0](v9.49.0...v9.50.0) (2026-07-03) ### Features * localized unread count ([#1787](#1787)) ([0a40196](0a40196))
|
🎉 This PR is included in version 9.50.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
isekovanic
added a commit
to GetStream/stream-chat-react-native
that referenced
this pull request
Jul 3, 2026
## 🎯 Goal SDK followup to this PR: GetStream/stream-chat-js#1787. All details can be read there. ## 🛠 Implementation details <!-- Provide a description of the implementation --> ## 🎨 UI Changes <!-- Add relevant screenshots --> <details> <summary>iOS</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> <details> <summary>Android</summary> <table> <thead> <tr> <td>Before</td> <td>After</td> </tr> </thead> <tbody> <tr> <td> <!--<img src="" /> --> </td> <td> <!--<img src="" /> --> </td> </tr> </tbody> </table> </details> ## 🧪 Testing <!-- Explain how this change can be tested (or why it can't be tested) --> ## ☑️ Checklist - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required) - [ ] PR targets the `develop` branch - [ ] Documentation is updated - [ ] New code is tested in main example apps, including all possible scenarios - [ ] SampleApp iOS and Android - [ ] Expo iOS and Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLA
Description of the changes, What, Why and How?
Spec: https://stream-wiki.notion.site/Local-Unread-Count-specification-38b6a5d7f9f68073a5e1c73298fe0d71
Adds an optin, client side unread count for channels that have read events disabled (e.g. livestreams). Those channels normally don't track unread at all and so
_countMessageAsUnreadbails out wheneverown_capabilitieslacksread-events, so integrators have no "N new messages" affordance to show while scrolled up.With the new
isLocalUnreadCountEnabledclient option (defaultfalse), the SDK maintains a purely local unread count for those channels. It increments on incoming messages and is reset via the newchannel.markReadLocally()method, which dispatches a client onlymessage.local_readevent. That event reuses the exactmessage.readstate logic in_handleChannelEvent(so read state updates stay in one place) but skipssyncDeliveredCandidates(), so the count is never sent to the backend.hasReadEvents()centralizes the capability check.When offline support is enabled, the local read/unread state is persisted for channels with disabled
read-eventsso the count survives a cold start. The offline DB handlesmessage.local_read(guarded so it can only affect channels with disabledread-eventschannels with the option on) and falls back gracefully whenstate.read[userId]is absent, since the server never sends a read for these channels.Behavior is fully gated behind the flag, so default off means no change for existing integrations.
Changelog
isLocalUnreadCountEnabledclient option for a client side unread count on channels with disabledread-events(e.g. livestreams)Channel.markReadLocally()to reset the local unread count with no backend callChannel.hasReadEvents()helpermessage.local_readevent