I've updated stream-chat-expo to 5.23.0 and found the issue. When I open a Thread screen and start typing, the messages in the thread have gone. Sometimes they come back when I scroll the screen or send a new message but sometimes they never come back.
Steps to reproduce
Steps to reproduce the behavior:
Go to a Channel screen
Go to a Thread screen
Start typing
Expected behavior
The sent messages keep being in the thread
Project Related Information
Customization
Click To Expand
- Channel.tsx
```
import { View, SafeAreaView } from 'react-native';
import { useEffect, useContext, useCallback } from 'react';
import {
Channel,
Chat,
MessageInput,
MessageList,
useAttachmentPickerContext,
} from 'stream-chat-expo';
import { useHeaderHeight } from '@react-navigation/elements';
import { useNavigation } from '@react-navigation/native';
import type { MessageType } from 'stream-chat-expo';
import { streamI18n } from '../../config/streamI18n';
import { AuthContext } from '../../contexts/AuthContext';
import { useStreamChatContext } from '../../contexts/StreamChatContext';
import type { NavigationProp } from '../../types/navigation';
import type { StreamChatGenerics } from '../../types/streamChat';
function Content() {
const { setThread } = useStreamChatContext();
const navigation = useNavigation();
const onThreadSelect = useCallback(
(message: MessageType | null) => {
setThread(message);
navigation.navigate('Thread');
},
[setThread, navigation]
);
return (
);
}
export function Show() {
const { chatClient } = useContext(AuthContext);
const { channel, thread } = useStreamChatContext();
const headerHeight = useHeaderHeight();
const { setTopInset } = useAttachmentPickerContext();
useEffect(() => {
setTopInset(headerHeight);
}, [headerHeight]);
return (
);
}
```
- Thread.tsx
```
import { SafeAreaView, View } from 'react-native';
import { useContext } from 'react';
import { Channel, Chat, Thread } from 'stream-chat-expo';
import { AuthContext } from '../../contexts/AuthContext';
import { useStreamChatContext } from '../../contexts/StreamChatContext';
import { streamI18n } from '../../config/streamI18n';
export function Index() {
const { chatClient } = useContext(AuthContext);
const { channel, setThread, thread } = useStreamChatContext();
return (
setThread(null)}
/>
);
}
```
Offline support
[ ] I have enabled offline support.
[x] The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)
Environment
Click To Expand
#### `package.json`:
```json
"dependencies": {
"@expo/vector-icons": "^13.0.0",
"@react-navigation/elements": "^1.3.3",
"@react-navigation/native": "^6.0.10",
"@react-navigation/stack": "^6.2.1",
"expo": "^48.0.0",
"expo-application": "~5.1.1",
"expo-av": "~13.2.1",
"expo-clipboard": "~4.1.2",
"expo-constants": "~14.2.1",
"expo-dev-client": "~2.2.1",
"expo-document-picker": "~11.2.2",
"expo-file-system": "~15.2.2",
"expo-haptics": "~12.2.1",
"expo-image-manipulator": "~11.1.1",
"expo-image-picker": "~14.1.1",
"expo-keep-awake": "~12.0.1",
"expo-linking": "~4.0.1",
"expo-localization": "~14.1.1",
"expo-location": "~15.1.1",
"expo-media-library": "~15.2.3",
"expo-sharing": "~11.2.2",
"expo-splash-screen": "~0.18.2",
"expo-status-bar": "~1.4.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.71.8",
"react-native-safe-area-context": "4.5.0",
"react-native-screens": "~3.20.0",
"react-native-storage": "^1.0.1",
"react-native-svg": "13.4.0",
"react-native-web": "~0.18.7",
"stream-chat-expo": "5.23.0",
},
```
**`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
- [x] Both
- **`stream-chat-react-native` version you're using that has this issue:**
- `"stream-chat-expo": "5.22.1"`
- Device/Emulator info:
- [ ] I am using a physical device
- OS version:
- Emulator: `iPhone 12` , `Pixel 3a` , `Pixel 4` , `Pixel6`
Issue
I've updated
stream-chat-expo
to5.23.0
and found the issue. When I open a Thread screen and start typing, the messages in the thread have gone. Sometimes they come back when I scroll the screen or send a new message but sometimes they never come back.Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
The sent messages keep being in the thread
Project Related Information
Customization
Click To Expand
- Channel.tsx ``` import { View, SafeAreaView } from 'react-native'; import { useEffect, useContext, useCallback } from 'react'; import { Channel, Chat, MessageInput, MessageList, useAttachmentPickerContext, } from 'stream-chat-expo'; import { useHeaderHeight } from '@react-navigation/elements'; import { useNavigation } from '@react-navigation/native'; import type { MessageType } from 'stream-chat-expo'; import { streamI18n } from '../../config/streamI18n'; import { AuthContext } from '../../contexts/AuthContext'; import { useStreamChatContext } from '../../contexts/StreamChatContext'; import type { NavigationProp } from '../../types/navigation'; import type { StreamChatGenerics } from '../../types/streamChat'; function Content() { const { setThread } = useStreamChatContext(); const navigation = useNavigation();
const onThreadSelect = useCallback(
(message: MessageType | null) => {
setThread(message);
navigation.navigate('Thread');
},
[setThread, navigation]
);
return (
);
}
export function Show() {
const { chatClient } = useContext(AuthContext);
const { channel, thread } = useStreamChatContext();
const headerHeight = useHeaderHeight();
const { setTopInset } = useAttachmentPickerContext();
useEffect(() => {
setTopInset(headerHeight);
}, [headerHeight]);
return (
);
}
```
- Thread.tsx
```
import { SafeAreaView, View } from 'react-native';
import { useContext } from 'react';
import { Channel, Chat, Thread } from 'stream-chat-expo';
import { AuthContext } from '../../contexts/AuthContext';
import { useStreamChatContext } from '../../contexts/StreamChatContext';
import { streamI18n } from '../../config/streamI18n';
export function Index() {
const { chatClient } = useContext(AuthContext);
const { channel, setThread, thread } = useStreamChatContext();
return (
setThread(null)}
/>
);
}
```
Offline support
Environment
Click To Expand
#### `package.json`: ```json "dependencies": { "@expo/vector-icons": "^13.0.0", "@react-navigation/elements": "^1.3.3", "@react-navigation/native": "^6.0.10", "@react-navigation/stack": "^6.2.1", "expo": "^48.0.0", "expo-application": "~5.1.1", "expo-av": "~13.2.1", "expo-clipboard": "~4.1.2", "expo-constants": "~14.2.1", "expo-dev-client": "~2.2.1", "expo-document-picker": "~11.2.2", "expo-file-system": "~15.2.2", "expo-haptics": "~12.2.1", "expo-image-manipulator": "~11.1.1", "expo-image-picker": "~14.1.1", "expo-keep-awake": "~12.0.1", "expo-linking": "~4.0.1", "expo-localization": "~14.1.1", "expo-location": "~15.1.1", "expo-media-library": "~15.2.3", "expo-sharing": "~11.2.2", "expo-splash-screen": "~0.18.2", "expo-status-bar": "~1.4.4", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.71.8", "react-native-safe-area-context": "4.5.0", "react-native-screens": "~3.20.0", "react-native-storage": "^1.0.1", "react-native-svg": "13.4.0", "react-native-web": "~0.18.7", "stream-chat-expo": "5.23.0", }, ``` **`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 - [x] Both - **`stream-chat-react-native` version you're using that has this issue:** - `"stream-chat-expo": "5.22.1"` - Device/Emulator info: - [ ] I am using a physical device - OS version: - Emulator: `iPhone 12` , `Pixel 3a` , `Pixel 4` , `Pixel6`
Additional context
Screenshots
Click To Expand
- iOS https://github.com/GetStream/stream-chat-react-native/assets/17227480/882be470-791d-4480-97af-216a6c3de283 - Android https://github.com/GetStream/stream-chat-react-native/assets/17227480/fe0691e7-0cdf-4cbb-a139-a38ccd8b8f36