GetStream / stream-chat-react-native

💬 React-Native Chat SDK ➜ Stream Chat. Includes a tutorial on building your own chat app experience using React-Native, React-Navigation and Stream
https://getstream.io/chat/sdk/react-native/
Other
975 stars 325 forks source link

[🐛] Offline Mode Unread Count Out of Sync #2377

Closed tao-qian closed 9 months ago

tao-qian commented 10 months ago

Issue

Similar to https://github.com/GetStream/stream-chat-react-native/issues/1996, we are seeing the unread count in the ChannelList preview being out of sync when using enableOfflineSupport.

Steps to reproduce

Steps to reproduce the behavior:

  1. close the app (both force close and normal close would work)
  2. send a message from a different device
  3. open the app
  4. the new message from step 2 would show up in the preview, but the unread count in the preview would be out of date. If there were unread messages previously in step 1, then that old number would be shown. If there weren't unread messages in step 1, then there would be no unread count badge.
  5. force close and reopen the app will update the unread count (just closing wouldn't help)

Note that this is not reproducible if the app has been in the foreground the whole time.

Expected behavior

The unread count should be updated.

Project Related Information

Customization

Click To Expand

```typescript jsx } filters={searchFilter} /> ```

Offline support

Environment

Click To Expand

#### `package.json`: ```json # N/A ``` **`react-native info` output:** ``` system: OS: macOS 14.1.1 CPU: (12) arm64 Apple M2 Pro Memory: 142.75 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.16.0 path: ~/.nvm/versions/node/v18.16.0/bin/node Yarn: version: 1.22.19 path: /opt/homebrew/bin/yarn npm: version: 9.5.1 path: ~/.nvm/versions/node/v18.16.0/bin/npm Watchman: version: 2023.12.04.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.11.3 path: /Users/tao/.rvm/gems/ruby-2.7.6/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 22.4 - iOS 16.4 - macOS 13.3 - tvOS 16.4 - watchOS 9.4 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: version: 14.3.1/14E300c path: /usr/bin/xcodebuild Languages: Java: version: 11.0.21 path: /usr/bin/javac Ruby: version: 2.7.6 path: /Users/tao/.rvm/rubies/ruby-2.7.6/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.71.14 wanted: 0.71.14 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [x] Both - **`stream-chat-react-native` version you're using that has this issue:** - `5.22.1` - Device/Emulator info: - [X] I am using a physical device - OS version: `e.g. Android 10` - Device/Emulator: `e.g. iPhone 11`

Additional context

Screenshots

Click To Expand


tao-qian commented 9 months ago

Hi! Are there any updates on this issue? @khushal87

This is one of the higher priority problems we have, because it is consistently reproducible and affects our users every time they open the app..

khushal87 commented 9 months ago

Hey @tao-qian, we are actively looking into this issue. Hope to fix this issue soon. 😄

Apologies for the delay.

tao-qian commented 9 months ago

Thank you!

stream-ci-bot commented 9 months ago

:tada: This issue has been resolved in version 5.24.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: