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
971 stars 324 forks source link

[🐛] Client UIKit and SDK are incompatible for Threads #2579

Open oddanderson opened 3 months ago

oddanderson commented 3 months ago

Issue

The UIKit for Threads requires a MessageType object for the following code snippet: <Channel channel={channel} thread={thread}>

However, the SDK to query both messages and threads returns objects that cannot be used as MessageType. e.g.

const threadMessage = await chatClient.getMessage(messageId); --> GetMessageAPIResponse<StreamChatGenerics>
const threads = await chatClient?.queryThreads({filter_logic}); --> Thread<StreamChatGenerics>[]

As a result, there is no way to query a thread object via the SDK and a messageId, and then render a thread on the screen. Currently. the only way to get a thread object is to do so from within MessageContext.

This means it's not possible in the React Native UIKit to receive a push notification about a comment on a message, and then take the user to a thread detail screen with the comments underneath.

I have verified that all other SDKs (React, Swift, Android) contain this functionality, allowing the UIKit to take a messageId: String parameter to render a thread list.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error etc...

Expected behavior

Project Related Information

Customization

Click To Expand

```typescript jsx # N/A ```

Offline support

Environment

Click To Expand

#### `package.json`: ```json # N/A ``` **`react-native info` output:** ``` OUTPUT GOES HERE ``` - **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 - [ ] Both - **`stream-chat-react-native` version you're using that has this issue:** - `e.g. 5.4.3` - Device/Emulator info: - [ ] I am using a physical device - OS version: `e.g. Android 10` - Device/Emulator: `e.g. iPhone 11`

Additional context

Screenshots

Click To Expand


khushal87 commented 5 days ago

Hey @oddanderson, we have recently introduced a thread list, and that might help you with this. https://getstream.io/chat/docs/sdk/reactnative/guides/custom-thread-list/