Skip to content

Commit 5bd1daa

Browse files
committed
Merge branch 'develop' of github.com:GetStream/stream-chat-react-native into develop
2 parents 06cf965 + d947ffa commit 5bd1daa

File tree

13 files changed

+112
-61
lines changed

13 files changed

+112
-61
lines changed

package/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Change Log
22

3+
### [6.6.2](https://github.com/GetStream/stream-chat-react-native/compare/v6.6.1...v6.6.2) (2025-02-19)
4+
5+
6+
### Bug Fixes
7+
8+
* message content inner container style overflow issue ([#2961](https://github.com/GetStream/stream-chat-react-native/issues/2961)) ([10b4a9d](https://github.com/GetStream/stream-chat-react-native/commit/10b4a9d093af4f3c16f6a18801ea2171846a199d))
9+
* poll vote fallback to id if name not present ([#2958](https://github.com/GetStream/stream-chat-react-native/issues/2958)) ([c68bc2d](https://github.com/GetStream/stream-chat-react-native/commit/c68bc2d5853a9de3936e0c308865d9bcef7d8292))
10+
* state break on channel prop update ([#2957](https://github.com/GetStream/stream-chat-react-native/issues/2957)) ([51893bb](https://github.com/GetStream/stream-chat-react-native/commit/51893bb06cc50765c0f382e38c85d4a0010b06a9))
11+
* use channel.cid instead of id ([#2960](https://github.com/GetStream/stream-chat-react-native/issues/2960)) ([eb86009](https://github.com/GetStream/stream-chat-react-native/commit/eb86009bb586df96d42f2091c23943ffe62e5018))
12+
13+
14+
### Performance Improvements
15+
16+
* do not rerender Channel on poll events ([#2959](https://github.com/GetStream/stream-chat-react-native/issues/2959)) ([b117342](https://github.com/GetStream/stream-chat-react-native/commit/b1173423141b620142002110d87cefc2798825fa))
17+
18+
### [6.6.1](https://github.com/GetStream/stream-chat-react-native/compare/v6.6.0...v6.6.1) (2025-02-18)
19+
20+
21+
### Bug Fixes
22+
23+
* change flatlist inside the bottom sheet modal and fix gesture in bottom sheet ([#2953](https://github.com/GetStream/stream-chat-react-native/issues/2953)) ([92f0b01](https://github.com/GetStream/stream-chat-react-native/commit/92f0b0102aacf0574222f59bd186da0f14e1a3d2))
24+
* show selected reaction tab in the message menu when long pressed in bottom reaction list ([#2955](https://github.com/GetStream/stream-chat-react-native/issues/2955)) ([f8e37f3](https://github.com/GetStream/stream-chat-react-native/commit/f8e37f3b6de8557fa91eb7be97cfed59a94bbbeb))
25+
326
## [6.6.0](https://github.com/GetStream/stream-chat-react-native/compare/v6.5.1...v6.6.0) (2025-02-13)
427

528

package/expo-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-expo",
33
"description": "The official Expo SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.6.0",
4+
"version": "6.6.2",
55
"author": {
66
"company": "Stream.io Inc",
77
"name": "Stream.io Inc"
@@ -10,7 +10,7 @@
1010
"main": "src/index.js",
1111
"types": "types/index.d.ts",
1212
"dependencies": {
13-
"stream-chat-react-native-core": "6.6.0"
13+
"stream-chat-react-native-core": "6.6.2"
1414
},
1515
"peerDependencies": {
1616
"expo": ">=51.0.0",

package/expo-package/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,10 +5113,10 @@ [email protected], stream-buffers@~2.2.0:
51135113
resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-2.2.0.tgz#91d5f5130d1cef96dcfa7f726945188741d09ee4"
51145114
integrity sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==
51155115

5116-
stream-chat-react-native-core@6.5.1:
5117-
version "6.5.1"
5118-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.5.1.tgz#5cbbc2bdd945ced533ab56ab0c93428eb806efb0"
5119-
integrity sha512-+jWjVrpXrKNvY/3Be5QL3TUEGlsaNBOBTeaWEz3wMGt1N5WHfwqU+N6t/WXQshke/C30mQSgfw6v2BUuPoNAAg==
5116+
stream-chat-react-native-core@6.6.1:
5117+
version "6.6.1"
5118+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.1.tgz#9f2221d0d47bf919bf6dee796a51b0364cb02ba7"
5119+
integrity sha512-ELNCIGY0fzZSR5zrOtuacANaPoCKSYirZ2+ydmFwdZ/H2AhUgcNGGRD6pqY7QqkiXne9mCsw0vZT5BFBTFMGgw==
51205120
dependencies:
51215121
"@gorhom/bottom-sheet" "^5.0.6"
51225122
dayjs "1.10.5"
@@ -5129,13 +5129,13 @@ [email protected]:
51295129
path "0.12.7"
51305130
react-native-markdown-package "1.8.2"
51315131
react-native-url-polyfill "^1.3.0"
5132-
stream-chat "^8.54.1"
5132+
stream-chat "^8.56.1"
51335133
use-sync-external-store "^1.4.0"
51345134

5135-
stream-chat@^8.54.1:
5136-
version "8.55.0"
5137-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.55.0.tgz#a4a651c4216185821a9d6b1ea55b6689a1a979a8"
5138-
integrity sha512-mdgB6LrDwCojf2xuHME2pnZIoIzAgd++CSsGlk9a+AUhmZMLnFFuMfg18uav3h9dKdRcRfFIgXe+raJgV6uIgA==
5135+
stream-chat@^8.56.1:
5136+
version "8.56.1"
5137+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.1.tgz#53779c987b9a46ea6908508f3b164cb14051bdc1"
5138+
integrity sha512-ZgNzD9z2JF65SE2J9Tur29fJTzpVAj2VYgu0OYqb3IEcpoP3ncLD0F3dsCvg8UDd/kYklkIncgvlAFAS4frYFw==
51395139
dependencies:
51405140
"@babel/runtime" "^7.16.3"
51415141
"@types/jsonwebtoken" "~9.0.0"

package/native-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-react-native",
33
"description": "The official React Native SDK for Stream Chat, a service for building chat applications",
4-
"version": "6.6.0",
4+
"version": "6.6.2",
55
"homepage": "https://www.npmjs.com/package/stream-chat-react-native",
66
"author": {
77
"company": "Stream.io Inc",
@@ -20,7 +20,7 @@
2020
"types": "types/index.d.ts",
2121
"dependencies": {
2222
"es6-symbol": "^3.1.3",
23-
"stream-chat-react-native-core": "6.6.0"
23+
"stream-chat-react-native-core": "6.6.2"
2424
},
2525
"peerDependencies": {
2626
"@react-native-camera-roll/camera-roll": ">=7.8.0",

package/native-package/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4242,10 +4242,10 @@ statuses@~1.5.0:
42424242
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
42434243
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==
42444244

4245-
stream-chat-react-native-core@6.5.1:
4246-
version "6.5.1"
4247-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.5.1.tgz#5cbbc2bdd945ced533ab56ab0c93428eb806efb0"
4248-
integrity sha512-+jWjVrpXrKNvY/3Be5QL3TUEGlsaNBOBTeaWEz3wMGt1N5WHfwqU+N6t/WXQshke/C30mQSgfw6v2BUuPoNAAg==
4245+
stream-chat-react-native-core@6.6.1:
4246+
version "6.6.1"
4247+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.6.1.tgz#9f2221d0d47bf919bf6dee796a51b0364cb02ba7"
4248+
integrity sha512-ELNCIGY0fzZSR5zrOtuacANaPoCKSYirZ2+ydmFwdZ/H2AhUgcNGGRD6pqY7QqkiXne9mCsw0vZT5BFBTFMGgw==
42494249
dependencies:
42504250
"@gorhom/bottom-sheet" "^5.0.6"
42514251
dayjs "1.10.5"
@@ -4258,13 +4258,13 @@ [email protected]:
42584258
path "0.12.7"
42594259
react-native-markdown-package "1.8.2"
42604260
react-native-url-polyfill "^1.3.0"
4261-
stream-chat "^8.54.1"
4261+
stream-chat "^8.56.1"
42624262
use-sync-external-store "^1.4.0"
42634263

4264-
stream-chat@^8.54.1:
4265-
version "8.55.0"
4266-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.55.0.tgz#a4a651c4216185821a9d6b1ea55b6689a1a979a8"
4267-
integrity sha512-mdgB6LrDwCojf2xuHME2pnZIoIzAgd++CSsGlk9a+AUhmZMLnFFuMfg18uav3h9dKdRcRfFIgXe+raJgV6uIgA==
4264+
stream-chat@^8.56.1:
4265+
version "8.56.1"
4266+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.56.1.tgz#53779c987b9a46ea6908508f3b164cb14051bdc1"
4267+
integrity sha512-ZgNzD9z2JF65SE2J9Tur29fJTzpVAj2VYgu0OYqb3IEcpoP3ncLD0F3dsCvg8UDd/kYklkIncgvlAFAS4frYFw==
42684268
dependencies:
42694269
"@babel/runtime" "^7.16.3"
42704270
"@types/jsonwebtoken" "~9.0.0"

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stream-chat-react-native-core",
33
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4-
"version": "6.6.0",
4+
"version": "6.6.2",
55
"author": {
66
"company": "Stream.io Inc",
77
"name": "Stream.io Inc"

package/src/components/Channel/Channel.tsx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
1+
import React, { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
22
import { KeyboardAvoidingViewProps, StyleSheet, Text, View } from 'react-native';
33

44
import debounce from 'lodash/debounce';
@@ -749,24 +749,34 @@ const ChannelWithContext = <
749749
? newMessageStateUpdateThrottleInterval
750750
: stateUpdateThrottleInterval;
751751

752-
const copyChannelState = useRef(
753-
throttle(
754-
() => {
755-
if (channel) {
756-
copyStateFromChannel(channel);
757-
copyMessagesStateFromChannel(channel);
758-
}
759-
},
760-
copyChannelStateThrottlingTime,
761-
throttleOptions,
762-
),
763-
).current;
752+
const copyChannelState = useMemo(
753+
() =>
754+
throttle(
755+
() => {
756+
if (channel) {
757+
copyStateFromChannel(channel);
758+
copyMessagesStateFromChannel(channel);
759+
}
760+
},
761+
copyChannelStateThrottlingTime,
762+
throttleOptions,
763+
),
764+
[channel, copyChannelStateThrottlingTime, copyMessagesStateFromChannel, copyStateFromChannel],
765+
);
764766

765767
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
766768
if (shouldSyncChannel) {
767-
// Ignore user.watching.start and user.watching.stop events
768-
const ignorableEvents = ['user.watching.start', 'user.watching.stop'];
769-
if (ignorableEvents.includes(event.type)) return;
769+
/**
770+
* Ignore user.watching.start and user.watching.stop as we should not copy the entire state when
771+
* they occur. Also ignore all poll related events since they're being handled in their own
772+
* reactive state and have no business having an effect on the Channel component.
773+
*/
774+
if (
775+
event.type.startsWith('poll.') ||
776+
event.type === 'user.watching.start' ||
777+
event.type === 'user.watching.stop'
778+
)
779+
return;
770780

771781
// If the event is typing.start or typing.stop, set the typing state
772782
const isTypingEvent = event.type === 'typing.start' || event.type === 'typing.stop';

package/src/components/Message/MessageSimple/MessageContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const styles = StyleSheet.create({
3838
borderTopLeftRadius: 16,
3939
borderTopRightRadius: 16,
4040
borderWidth: 1,
41+
overflow: 'hidden',
4142
},
4243
leftAlignContent: {
4344
justifyContent: 'flex-start',
@@ -154,6 +155,7 @@ const MessageContentWithContext = <
154155
borderRadiusS,
155156
borderTopLeftRadius,
156157
borderTopRightRadius,
158+
...container
157159
},
158160
containerInner,
159161
replyBorder,
@@ -251,7 +253,7 @@ const MessageContentWithContext = <
251253
});
252254
}
253255
}}
254-
style={({ pressed }) => ({ opacity: pressed ? 0.5 : 1 })}
256+
style={({ pressed }) => [{ opacity: pressed ? 0.5 : 1 }, container]}
255257
{...additionalPressableProps}
256258
>
257259
<View onLayout={onLayout} style={wrapper}>

package/src/components/MessageList/MessageList.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ const MessageListWithContext = <
579579
}
580580
}
581581
// eslint-disable-next-line react-hooks/exhaustive-deps
582-
}, [rawMessageList, threadList]);
582+
}, [channel, rawMessageList, threadList]);
583583

584584
const goToMessage = async (messageId: string) => {
585585
const indexOfParentInMessageList = processedMessageList.findIndex(
@@ -1097,12 +1097,13 @@ const MessageListWithContext = <
10971097
keyboardShouldPersistTaps='handled'
10981098
keyExtractor={keyExtractor}
10991099
ListFooterComponent={ListFooterComponent}
1100+
ListHeaderComponent={ListHeaderComponent}
11001101
/**
1101-
if autoscrollToTopThreshold is 10, we scroll to recent if before new list update it was already at the bottom (10 offset or below)
1102-
minIndexForVisible = 1 means that beyond item at index 1 will not change position on list updates
1103-
minIndexForVisible is not used when autoscrollToTopThreshold = 10
1102+
If autoscrollToTopThreshold is 10, we scroll to recent only if before the update, the list was already at the
1103+
bottom (10 offset or below).
1104+
minIndexForVisible = 1 means that beyond the item at index 1 we will not change the position on list updates,
1105+
however it is not used when autoscrollToTopThreshold = 10.
11041106
*/
1105-
ListHeaderComponent={ListHeaderComponent}
11061107
maintainVisibleContentPosition={{
11071108
autoscrollToTopThreshold: autoscrollToRecent ? 10 : undefined,
11081109
minIndexForVisible: 1,

package/src/components/MessageList/hooks/useShouldScrollToRecentOnNewOwnMessage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export function useShouldScrollToRecentOnNewOwnMessage<
3838
}
3939
}
4040
}
41-
// eslint-disable-next-line react-hooks/exhaustive-deps
42-
}, [rawMessageList]);
41+
}, [currentUserId, rawMessageList]);
4342

4443
return isMyOwnNewMessageRef;
4544
}

0 commit comments

Comments
 (0)