Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mark as unread and mark as read improvements #2833

Merged
merged 233 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
1ce7e8e
fix: remove netinfo from native handlers and add it as dev dependency…
khushal87 Jun 6, 2024
9b0367f
feat: remove usage of flatlist-mvcp in favour of mvcp support in RN >…
khushal87 Jun 6, 2024
e9f8a52
fix: change quotedMessage type to MessageType or undefined (#2527)
khushal87 Jun 6, 2024
85b17b7
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Jun 6, 2024
7ad0442
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Jun 7, 2024
633c76d
fix: change react-native-image-resizer to @bam.tech/react-native-imag…
khushal87 Jun 7, 2024
9f8f299
chore: resolve conflicts from develop
khushal87 Jun 18, 2024
3e73dfc
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Jun 19, 2024
62f5ca3
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Jun 21, 2024
87593c3
fix: add reanimated and gesture handler as peer deps to package
khushal87 Jun 21, 2024
c27a218
fix: change old gesture handler useAnimatedGestureHandler to the new …
khushal87 Jun 21, 2024
de929f3
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Jun 28, 2024
b967cfc
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Jun 28, 2024
622bbcb
feat: move react-native-quick-sqlite to op-sqlite (#2541)
khushal87 Jun 28, 2024
709d42b
chore: update deps of expo messaging app
khushal87 Jul 1, 2024
5e14f62
feat: use react-native-blob-util instead of the react-native-fs and m…
khushal87 Jul 5, 2024
573040b
fix: upgrade cameraroll, documentpicker, haptics feedback and image c…
khushal87 Jul 5, 2024
7f4a10d
fix: change react-native-image-crop-picker to react-native-image-pick…
khushal87 Jul 5, 2024
4f29a3f
docs: add migration guide
khushal87 Jul 5, 2024
8386bcd
fix: make expo-image-picker optional
khushal87 Jul 9, 2024
c660b0f
fix: make expo-image-picker optional
khushal87 Jul 9, 2024
c17a629
docs: apply docs changes
khushal87 Jul 9, 2024
b6039f3
Merge pull request #2581 from GetStream/upgrade-deps-cameraroll-image…
khushal87 Jul 10, 2024
d6741b8
fix: conflicts from branch
khushal87 Jul 10, 2024
4f8dbad
fix: add check for handlers in native.ts
khushal87 Jul 10, 2024
d6788b8
Merge pull request #2582 from GetStream/PBE-5070-rn-image-picker
khushal87 Jul 10, 2024
49ab5f4
chore: resolve conflicts from develop
khushal87 Jul 24, 2024
09b5251
fix: resolve conflicts from branch develop to v6 (#2621)
khushal87 Aug 20, 2024
25eb0ff
chore: resolve conflicts from develop
khushal87 Aug 20, 2024
3a13460
chore: resolve conflicts from develop
khushal87 Aug 20, 2024
2f541da
chore: resolve conflicts from develop
khushal87 Aug 20, 2024
1a917b8
chore: fix vale issues
khushal87 Aug 20, 2024
3737e73
chore: fix vale issues
khushal87 Aug 20, 2024
e79ae2e
fix: react-native-safe-area-context ios build issue
khushal87 Aug 21, 2024
4454761
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Aug 21, 2024
35bffd8
fix: bottom sheet version
khushal87 Aug 21, 2024
7325b99
chore: resolve conflicts from develop
khushal87 Aug 21, 2024
a0b617e
fix: remove flipper debugger
khushal87 Aug 21, 2024
05005ce
fix: issue with rn-svg on android and rn-video fabric compatibility
khushal87 Aug 21, 2024
bb58577
fix: animations usage in ImageGallery (#2627)
khushal87 Aug 22, 2024
b14e4db
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Aug 26, 2024
d676da9
fix: remove rn-sqlite patch
khushal87 Aug 26, 2024
924beb4
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Aug 26, 2024
de27078
fix: animations laginess on the ImageGallery and MessageOverlay on ne…
khushal87 Aug 27, 2024
36f2fe1
chore: resolve conflicts from develop
khushal87 Aug 30, 2024
8207356
chore: resolve conflicts from develop (#2682)
khushal87 Sep 19, 2024
8da3ac0
fix: chat.test.ts
khushal87 Sep 26, 2024
f66b4a0
chore: cleanup v3 docs setup and e2e tests from project (#2701)
khushal87 Oct 9, 2024
8b0b4f4
feat: add new message action list and reaction selector UI (#2686)
khushal87 Oct 9, 2024
61fa097
feat: remove StreamChatRN in favour of a global context ChatConfigCon…
khushal87 Oct 11, 2024
0e5a3ef
fix: remove deprecated code from v6 branch (#2702)
khushal87 Oct 11, 2024
1c52f4f
chore: resolve conflicts from develop
khushal87 Oct 15, 2024
56c0b41
feat: new reaction list design and improvements to MessageSimple comp…
khushal87 Oct 15, 2024
db90318
chore: resolve conflicts from v6
khushal87 Oct 15, 2024
e9cc98b
chore: resolve conflicts from develop
khushal87 Oct 21, 2024
7383f88
fix: circular dependency issue
khushal87 Oct 21, 2024
7ea133b
fix: upgrade expo to latest in expo messaging app
khushal87 Oct 21, 2024
5b7aa9c
fix: padding for reaction picker
khushal87 Oct 21, 2024
2f2fb51
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Oct 23, 2024
f087ee5
fix: update dependencies for native cli apps
khushal87 Oct 23, 2024
ac8157f
fix: add Flatlist mvcp as optional package and peer deps versions (#2…
khushal87 Oct 24, 2024
8c7a4ea
chore: resolve conflicts from develop
khushal87 Oct 24, 2024
edab454
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Oct 24, 2024
76cb67d
fix: design issues with ReactionList bottom UI (#2717)
khushal87 Oct 24, 2024
457c694
fix: add a log that complains for removal for mvcp package on RN vers…
khushal87 Oct 25, 2024
c17e542
Merge branch 'develop' of github.com:GetStream/stream-chat-react-nati…
khushal87 Oct 25, 2024
0759817
fix: bottom sheet modal improvements
khushal87 Oct 25, 2024
f093028
fix: use process reactions improvements for thread list
khushal87 Oct 25, 2024
8f4ca60
docs: docusaurus setup for v6 release (#2721)
khushal87 Oct 25, 2024
252e90c
chore: setup workflow and improve migration guide for v6 rc release (…
khushal87 Oct 25, 2024
002ed5a
fix: linting issues
khushal87 Oct 25, 2024
df4d9c0
featv6 rc release
khushal87 Oct 25, 2024
eff9872
feat!: v6 rc release
khushal87 Oct 25, 2024
c4d3e66
feat!: v6 rc release
khushal87 Oct 25, 2024
97762b5
BREAKING CHANGE: v6 rc release
khushal87 Oct 25, 2024
2f36076
fix: upgrade react native version in sample apps to 0.73.10 (#2728)
khushal87 Oct 25, 2024
4e68d2d
feat!: rc release v6 (#2729)
khushal87 Oct 25, 2024
72f7adc
feat: styles changes for MessageActionList
khushal87 Oct 28, 2024
0bad2c5
Merge pull request #2730 from GetStream/v6-rc-release-2
khushal87 Oct 28, 2024
ab94a9e
feat: styles changes for MessageUserReactions
khushal87 Oct 28, 2024
0b8a8d7
Merge pull request #2731 from GetStream/v6-rc-release-3
khushal87 Oct 28, 2024
15b125c
chore: fix noteKeywords in release config
khushal87 Oct 28, 2024
2a7d931
Merge pull request #2732 from GetStream/v6-rc-release-4
khushal87 Oct 28, 2024
1dfe741
feat: improve Message.tsx render conditional (#2733)
khushal87 Oct 28, 2024
4756d0d
feat: remove dry run mode from release config
khushal87 Oct 28, 2024
308806e
fix: way of reading the value from animated shared values in the comp…
khushal87 Oct 29, 2024
4366578
fix: upgrade the RN version in example apps to 0.75.4 (#2739)
khushal87 Oct 29, 2024
3c05a9f
feat: move react native image resizer native module to the SDK (#2751)
khushal87 Nov 4, 2024
d1ecfd7
fix: attachment picker image picker icon visibility as per dependency
khushal87 Nov 4, 2024
f65878d
Merge pull request #2757 from GetStream/attachment-picker-icons-visib…
isekovanic Nov 5, 2024
aeeea75
Merge branch 'develop' into feat/forward-port-polls
isekovanic Nov 5, 2024
4aea22d
fix: changes after merge
isekovanic Nov 5, 2024
7b5dc30
fix: lint issues
isekovanic Nov 5, 2024
ca1853a
fix: revalidate pod cache
isekovanic Nov 5, 2024
0299da9
chore: revert cache revalidation
isekovanic Nov 5, 2024
7f3dcf4
Merge pull request #2759 from GetStream/feat/forward-port-polls
isekovanic Nov 5, 2024
3a6d4c3
fix: sender and receiver message theme colors
khushal87 Nov 8, 2024
7c6fa15
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Nov 8, 2024
9b02af2
fix: sender and receiver message theme colors (#2767)
khushal87 Nov 8, 2024
d778d6d
fix: upgrade op-sqlite version to be compatible with latest react nat…
khushal87 Nov 8, 2024
325629f
chore: backport the polls docs to v5 too
isekovanic Nov 8, 2024
09f06ba
fix: add versioned sidebar update as well
isekovanic Nov 8, 2024
65f1a6b
Merge pull request #2769 from GetStream/chore/backport-poll-docs-to-v5
isekovanic Nov 8, 2024
77980fa
chore: upgrade sample apps to RN 0.76.1 and added new arch docs (#2756)
khushal87 Nov 8, 2024
3efe254
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Nov 8, 2024
fd88bef
fix: poll offline fixes (#2772)
isekovanic Nov 13, 2024
5be800c
fix: revert cache revalidation and introduce dummy change in docs to …
isekovanic Nov 13, 2024
bf52846
fix: resolve lint issues once again
isekovanic Nov 13, 2024
684d659
fix: remove channel constants - isAdmin, isOwner and isModerator
khushal87 Nov 11, 2024
c252930
fix: offline mode channel hydration issues
isekovanic Nov 14, 2024
5ebda4f
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Nov 14, 2024
511c5f2
fix: remove channel constants - isAdmin, isOwner and isModerator (#2778)
khushal87 Nov 14, 2024
913ce07
Merge pull request #2779 from GetStream/fix/critical-v6-bugs
isekovanic Nov 14, 2024
a4c1105
fix: faulty build for sample apps
khushal87 Nov 14, 2024
4811497
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Nov 14, 2024
5c03e20
Merge branch 'develop' into v6.0.0
isekovanic Nov 14, 2024
8875dbd
fix: update yarn.lock files to fix build
isekovanic Nov 14, 2024
d1c9755
fix: android modal size
isekovanic Nov 14, 2024
81507fb
Merge pull request #2783 from GetStream/fix/android-poll-creation-mod…
isekovanic Nov 14, 2024
eaecbf6
fix: race conditions on db open and close
isekovanic Nov 14, 2024
d353d32
fix: move dropTables into check as well
isekovanic Nov 14, 2024
32ab860
fix: crash in some instances of useIsChannelMuted hook invocation
isekovanic Nov 15, 2024
f8c7545
fix: properly use hook in channel preview
isekovanic Nov 15, 2024
bbf6a85
fix: edge cases and test
isekovanic Nov 15, 2024
f667148
Merge pull request #2786 from GetStream/fix/is-muted-hook-crash
isekovanic Nov 15, 2024
e029830
Merge pull request #2785 from GetStream/fix/db-open-close-issues
isekovanic Nov 15, 2024
88d12f9
refactor: remove stale subscriber count logic and types refactor (#2782)
khushal87 Nov 18, 2024
4144ec1
Merge branch 'message-pagination' of github.com:GetStream/stream-chat…
khushal87 Nov 18, 2024
99abac0
fix: regex state machine stack depth crash
isekovanic Nov 18, 2024
e847dca
fix: update test
isekovanic Nov 18, 2024
32115ca
Merge pull request #2789 from GetStream/fix/regex-max-stack-depth-crash
isekovanic Nov 18, 2024
b818b0f
fix: channel hook regressions
isekovanic Nov 19, 2024
fcf7001
Merge pull request #2792 from GetStream/fix/channel-hook-extraction-r…
isekovanic Nov 19, 2024
84f1468
fix: expo media library permissions race conditions
isekovanic Nov 19, 2024
5ba1784
Merge pull request #2793 from GetStream/fix/expo-media-permissions-race
isekovanic Nov 19, 2024
8ec3253
feat: new message list pagination implementation
khushal87 Nov 19, 2024
e900410
feat: enable moderation v2 on the sdk and sample apps
isekovanic Nov 19, 2024
2767234
fix: listen to correct channel read events
isekovanic Nov 19, 2024
ec3ebbd
Merge pull request #2795 from GetStream/fix/listen-to-correct-read-ev…
isekovanic Nov 19, 2024
6217d94
fix: add FlatList default for Expo
isekovanic Nov 19, 2024
deaf359
fix: channel state initial data
khushal87 Nov 20, 2024
9f3eb2a
Merge pull request #2798 from GetStream/fix/flat-list-export-expo
isekovanic Nov 20, 2024
6568ff8
Merge pull request #2794 from GetStream/feat/moderation-v2
isekovanic Nov 20, 2024
bc98c8f
fix: revert back the onStartReached change
khushal87 Nov 20, 2024
74dfcf1
fix: lint and tests
khushal87 Nov 20, 2024
14e003f
feat: add support for membership customization
isekovanic Nov 20, 2024
d4dbb2b
Merge pull request #2800 from GetStream/feat/membership-customization…
isekovanic Nov 20, 2024
1db8637
fix: modify deployment workflow of SampleApp so that we get a release
isekovanic Nov 20, 2024
4883751
fix: try bumping firebase version
isekovanic Nov 20, 2024
b1fc71d
fix: revert FB changes and CODE_SIGN_STYLE regression
isekovanic Nov 20, 2024
af52e85
fix: PROVISIONING_PROFILE_SPECIFIER specific val
isekovanic Nov 20, 2024
ca4590a
fix: certificate distribution settings
isekovanic Nov 20, 2024
5a077bf
fix: upgrade bottom sheet and fix reanimated errors in new arch (#2806)
isekovanic Nov 21, 2024
64818b6
fix: added tests for the hooks and message pagination
khushal87 Nov 22, 2024
078ad3c
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Nov 22, 2024
24664a9
Merge branch 'message-pagination' of github.com:GetStream/stream-chat…
khushal87 Nov 22, 2024
c124070
fix: podlock file for sample app
khushal87 Nov 22, 2024
7b414ca
fix: channel.state break on going to background
isekovanic Nov 22, 2024
6201f33
Merge pull request #2807 from GetStream/fix/channel-state-break-on-ba…
isekovanic Nov 22, 2024
df28d8e
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Nov 22, 2024
dc7d09c
fix: expo media library exceptions in new arch
isekovanic Nov 25, 2024
44025e4
chore: resolve conflicts from develop on v6 (#2813)
khushal87 Nov 25, 2024
baa5360
fix: camera roll issues
isekovanic Nov 25, 2024
a6936e0
fix: refactor photo resolution to native level
isekovanic Nov 25, 2024
e30decf
fix: expo media library
isekovanic Nov 25, 2024
096dde1
fix: properly resolve videos too
isekovanic Nov 25, 2024
1d61f8b
chore: remove console.log
isekovanic Nov 25, 2024
a52b38b
chore: update yarn.lock files for example apps
khushal87 Nov 26, 2024
aa353f1
fix: throttle logic for the copy message state
khushal87 Nov 26, 2024
b469846
fix: bring back camera-roll to SampleApp
isekovanic Nov 26, 2024
7397107
fix: also podfile.lock
isekovanic Nov 26, 2024
1f1589b
Merge branch 'v6.0.0' into fix/asset-library-issues
isekovanic Nov 26, 2024
b1fadc0
fix: remove console.log
isekovanic Nov 26, 2024
72d7c7d
fix: issues with video preview
isekovanic Nov 26, 2024
45488c1
chore: remove console.log
isekovanic Nov 26, 2024
7f54037
feat: mark as unread and handle markRead in the SDK
khushal87 Dec 2, 2024
289331f
chore: resolve conflicts from develop
khushal87 Dec 3, 2024
ab21961
chore: resolve conflicts from develop
khushal87 Dec 3, 2024
dec67fc
feat: ai-bot integration poc (#2819)
isekovanic Dec 3, 2024
7a9acb5
fix: message list improvements and channel first message mark unread …
khushal87 Dec 4, 2024
c032297
fix: lint issues
khushal87 Dec 4, 2024
43be5ac
chore: upgrade expo sample app to expo 52
khushal87 Dec 5, 2024
bab78f4
fix: remove unnecessary android and ios permissions
khushal87 Dec 5, 2024
f310076
Merge pull request #2828 from GetStream/expo-52-sample-app-upgrade
isekovanic Dec 5, 2024
a1090cb
Merge pull request #2815 from GetStream/fix/asset-library-issues
isekovanic Dec 5, 2024
cb0b223
Merge branch 'develop' into v6.0.0
isekovanic Dec 5, 2024
de095b0
chore: update yarn.lock files
isekovanic Dec 5, 2024
a063caf
tests: add tests for the mark as unread feature
khushal87 Dec 6, 2024
559c4c0
fix: unread message indicator on small message list
khushal87 Dec 6, 2024
4dbaef2
fix: date separator for small list
khushal87 Dec 6, 2024
38356fc
fix: improve scrolling fast scenario for scroll to target message
khushal87 Dec 6, 2024
9692f1a
refactor: remove stale subscriber count logic and types refactor (#2832)
khushal87 Dec 6, 2024
6975abe
feat: Message list pagination implementation using hasPrev and hasNex…
khushal87 Dec 6, 2024
20a5826
chore: resolve conflicts
khushal87 Dec 6, 2024
f1977dd
fix: add theme for the bottom sheet styles and message user reactions…
khushal87 Dec 6, 2024
ab8f1a2
fix: refactor some of the buttons
isekovanic Dec 6, 2024
1fd1b69
fix: refactor context usage
isekovanic Dec 6, 2024
0907f29
fix: solve final cyclical dep
isekovanic Dec 6, 2024
7577f5c
fix: add corrected app.json
isekovanic Dec 6, 2024
1d914f9
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Dec 9, 2024
194d821
tests: add tests
khushal87 Dec 9, 2024
cbf111e
fix: convert all poll buttons to pressables
isekovanic Dec 9, 2024
d3de92c
fix: lint issues (that somehow passed without issues before)
isekovanic Dec 9, 2024
ca873e5
chore: move add comment button to correct file
isekovanic Dec 9, 2024
3992fcc
fix: move vote button to correct file too
isekovanic Dec 9, 2024
b0fda59
Merge pull request #2834 from GetStream/fix/v6-poll-circular-requires
isekovanic Dec 9, 2024
0f2fdf3
fix: scroll to first unread message bug
khushal87 Dec 9, 2024
f2bc213
fix: tests and lint issues
khushal87 Dec 9, 2024
9b2dd77
fix: image gallery issues (#2835)
isekovanic Dec 10, 2024
f8d0af5
fix: attachment picker unread floating indicator issue
khushal87 Dec 10, 2024
abbcdf8
fix: remove unnecessary logs
khushal87 Dec 10, 2024
4ec4985
Merge branch 'v6.0.0' of github.com:GetStream/stream-chat-react-nativ…
khushal87 Dec 10, 2024
fe294a2
fix: add tests
khushal87 Dec 10, 2024
d9e83fc
fix: add improvements around read channel state
khushal87 Dec 11, 2024
875c6a4
fix: image gallery header and footer safe area view (#2840)
khushal87 Dec 11, 2024
5eebbae
fix: tests and lint issues
khushal87 Dec 11, 2024
6b40415
fix: tests and lint issues
khushal87 Dec 11, 2024
82ec7d9
chore: remove disable if frozen channel (#2841)
isekovanic Dec 11, 2024
d5c3294
fix: old arch image resizer native module spec file name fix (#2842)
khushal87 Dec 11, 2024
21f18e5
Merge branch 'develop' into v6.0.0
isekovanic Dec 11, 2024
f3c3ee3
chore: fix all of the GH workflow stuff related to v6 in prep for rel…
isekovanic Dec 11, 2024
ff2e947
chore: resolve conflicts from v6
khushal87 Dec 12, 2024
5d1d3d1
chore: resolve conflicts from develop
khushal87 Dec 16, 2024
9c8ddbf
fix: move logic to component
khushal87 Dec 16, 2024
1dbded9
fix: lint issues
khushal87 Dec 16, 2024
67ea2f8
fix: issues with handleSyncDb events
khushal87 Dec 17, 2024
f8f1208
fix: dep update
khushal87 Dec 17, 2024
da1b5c3
fix: dep update
khushal87 Dec 17, 2024
850b2da
fix: resolve conflicts from develop
khushal87 Dec 23, 2024
f962540
fiX: message list scroll settime outs
khushal87 Dec 23, 2024
e29c8cf
chore: resolve conflicts from develop
khushal87 Dec 23, 2024
5828137
fix: lint issues
khushal87 Dec 24, 2024
2300ffc
fix: broken tests
khushal87 Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/SampleApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ PODS:
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.10)
- SocketRocket (0.7.1)
- stream-chat-react-native (6.0.0):
- stream-chat-react-native (6.0.1):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2474,7 +2474,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost: 1dca942403ed9342f98334bf4c3621f011aa7946
DoubleConversion: f16ae600a246532c4020132d54af21d0ddb2a385
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
FBLazyVector: 1bf99bb46c6af9a2712592e707347315f23947aa
Firebase: 7a56fe4f56b5ab81b86a6822f5b8f909ae6fc7e2
FirebaseAnalytics: 2f4a11eeb7a0e9c6fcf642d4e6aaca7fa4d38c28
Expand All @@ -2488,7 +2488,7 @@ SPEC CHECKSUMS:
FirebaseRemoteConfigInterop: e75e348953352a000331eb77caf01e424248e176
FirebaseSessions: b252b3f91a51186188882ea8e7e1730fc1eee391
fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
GoogleAppMeasurement: ee5c2d2242816773fbf79e5b0563f5355ef1c315
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
Expand Down Expand Up @@ -2576,9 +2576,9 @@ SPEC CHECKSUMS:
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
stream-chat-react-native: 557a9b07b068fea9a1670302ca43f8589d884e33
stream-chat-react-native: 4b3bb162446ad9b25c745fc8083a2516d363d5eb
Yoga: 7548e4449365bf0ef60db4aefe58abff37fcabec

PODFILE CHECKSUM: 4f662370295f8f9cee909f1a4c59a614999a209d

COCOAPODS: 1.14.3
COCOAPODS: 1.16.2
8 changes: 4 additions & 4 deletions examples/SampleApp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7952,10 +7952,10 @@ statuses@~1.5.0:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

[email protected].0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.0.0.tgz#77798c7082877572ef70223e1f799d22f0c78fe7"
integrity sha512-3cFao8iL2MjP7nhVRAl1vi526FbPlqUj4BHnYQ7sUNe+xb4z/HCEL6fKFh8kIfK5MEAacOQO4juPPQktoIf7zg==
[email protected].1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-6.0.1.tgz#a67f14685519cafa58466d28eee8f1edc9dbafcf"
integrity sha512-kyHgGn2PF+JTt7eEKdHMot9Nxzx+yecnlut9oyhi/IJbxOwpjIgB87+rdQXEI5o8SeNwQuAeV3VatxGaxl5Jbw==
dependencies:
"@gorhom/bottom-sheet" "^5.0.6"
dayjs "1.10.5"
Expand Down
125 changes: 101 additions & 24 deletions package/src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Channel as ChannelType,
EventHandler,
FormatMessageResponse,
logChatPromiseExecution,
MessageResponse,
Reaction,
SendMessageAPIResponse,
Expand Down Expand Up @@ -92,7 +91,7 @@ import {
isImagePickerAvailable,
} from '../../native';
import * as dbApi from '../../store/apis';
import { DefaultStreamChatGenerics, FileTypes } from '../../types/types';
import { ChannelUnreadState, DefaultStreamChatGenerics, FileTypes } from '../../types/types';
import { addReactionToLocalState } from '../../utils/addReactionToLocalState';
import { compressedImageURI } from '../../utils/compressImage';
import { DBSyncManager } from '../../utils/DBSyncManager';
Expand Down Expand Up @@ -179,6 +178,7 @@ import { ScrollToBottomButton as ScrollToBottomButtonDefault } from '../MessageL
import { StickyHeader as StickyHeaderDefault } from '../MessageList/StickyHeader';
import { TypingIndicator as TypingIndicatorDefault } from '../MessageList/TypingIndicator';
import { TypingIndicatorContainer as TypingIndicatorContainerDefault } from '../MessageList/TypingIndicatorContainer';
import { UnreadMessagesNotification as UnreadMessagesNotificationDefault } from '../MessageList/UnreadMessagesNotification';
import { MessageActionList as MessageActionListDefault } from '../MessageMenu/MessageActionList';
import { MessageActionListItem as MessageActionListItemDefault } from '../MessageMenu/MessageActionListItem';
import { MessageMenu as MessageMenuDefault } from '../MessageMenu/MessageMenu';
Expand All @@ -188,6 +188,15 @@ import { MessageUserReactionsAvatar as MessageUserReactionsAvatarDefault } from
import { MessageUserReactionsItem as MessageUserReactionsItemDefault } from '../MessageMenu/MessageUserReactionsItem';
import { Reply as ReplyDefault } from '../Reply/Reply';

export type MarkReadFunctionOptions = {
/**
* Signal, whether the `channelUnreadUiState` should be updated.
* By default, the local state update is prevented when the Channel component is mounted.
* This is in order to keep the UI indicating the original unread state, when the user opens a channel.
*/
updateChannelUnreadState?: boolean;
};

const styles = StyleSheet.create({
selectChannel: { fontWeight: 'bold', padding: 16 },
});
Expand Down Expand Up @@ -301,6 +310,7 @@ export type ChannelPropsWithContext<
| 'handleDelete'
| 'handleEdit'
| 'handleFlag'
| 'handleMarkUnread'
| 'handleMute'
| 'handlePinMessage'
| 'handleReaction'
Expand Down Expand Up @@ -360,6 +370,7 @@ export type ChannelPropsWithContext<
| 'VideoThumbnail'
| 'PollContent'
| 'hasCreatePoll'
| 'UnreadMessagesNotification'
| 'StreamingMessageView'
>
> &
Expand All @@ -384,7 +395,10 @@ export type ChannelPropsWithContext<
* Overrides the Stream default mark channel read request (Advanced usage only)
* @param channel Channel object
*/
doMarkReadRequest?: (channel: ChannelType<StreamChatGenerics>) => void;
doMarkReadRequest?: (
channel: ChannelType<StreamChatGenerics>,
setChannelUnreadUiState?: (state: ChannelUnreadState) => void,
) => void;
/**
* Overrides the Stream default send message request (Advanced usage only)
* @param channelId
Expand Down Expand Up @@ -433,6 +447,10 @@ export type ChannelPropsWithContext<
* Custom loading error indicator to override the Stream default
*/
LoadingErrorIndicator?: React.ComponentType<LoadingErrorProps>;
/**
* Boolean flag to enable/disable marking the channel as read on mount
*/
markReadOnMount?: boolean;
maxMessageLength?: number;
/**
* Load the channel at a specified message instead of the most recent message.
Expand Down Expand Up @@ -529,6 +547,7 @@ const ChannelWithContext = <
handleDelete,
handleEdit,
handleFlag,
handleMarkUnread,
handleMute,
handlePinMessage,
handleQuotedReply,
Expand Down Expand Up @@ -566,6 +585,7 @@ const ChannelWithContext = <
loadingMore: loadingMoreProp,
loadingMoreRecent: loadingMoreRecentProp,
markdownRules,
markReadOnMount = true,
maxMessageLength: maxMessageLengthProp,
maxNumberOfFiles = 10,
maxTimeBetweenGroupedMessages,
Expand Down Expand Up @@ -647,6 +667,7 @@ const ChannelWithContext = <
threadMessages,
TypingIndicator = TypingIndicatorDefault,
TypingIndicatorContainer = TypingIndicatorContainerDefault,
UnreadMessagesNotification = UnreadMessagesNotificationDefault,
UploadProgressIndicator = UploadProgressIndicatorDefault,
UrlPreview = CardDefault,
VideoThumbnail = VideoThumbnailDefault,
Expand Down Expand Up @@ -674,10 +695,13 @@ const ChannelWithContext = <
const [thread, setThread] = useState<MessageType<StreamChatGenerics> | null>(threadProps || null);
const [threadHasMore, setThreadHasMore] = useState(true);
const [threadLoadingMore, setThreadLoadingMore] = useState(false);
const [channelUnreadState, setChannelUnreadState] = useState<ChannelUnreadState | undefined>(
undefined,
);

const syncingChannelRef = useRef(false);

const { setTargetedMessage, targetedMessage } = useTargetedMessage();
const { highlightedMessageId, setTargetedMessage, targetedMessage } = useTargetedMessage();

/**
* This ref will hold the abort controllers for
Expand All @@ -692,6 +716,7 @@ const ChannelWithContext = <
const {
copyStateFromChannel,
initStateFromChannel,
setRead,
setTyping,
state: channelState,
} = useChannelDataState<StreamChatGenerics>(channel);
Expand Down Expand Up @@ -754,6 +779,22 @@ const ChannelWithContext = <
}
}

if (event.type === 'notification.mark_unread') {
setChannelUnreadState((prev) => {
if (!(event.last_read_at && event.user)) return prev;
return {
first_unread_message_id: event.first_unread_message_id,
last_read: new Date(event.last_read_at),
last_read_message_id: event.last_read_message_id,
unread_messages: event.unread_messages ?? 0,
};
});
}

if (event.type === 'channel.truncated' && event.cid === channel.cid) {
setChannelUnreadState(undefined);
}

// only update channel state if the events are not the previously subscribed useEffect's subscription events
if (channel && channel.initialized) {
copyChannelState();
Expand All @@ -764,6 +805,8 @@ const ChannelWithContext = <
useEffect(() => {
let listener: ReturnType<typeof channel.on>;
const initChannel = async () => {
setLastRead(new Date());
const unreadCount = channel.countUnread();
if (!channel || !shouldSyncChannel || channel.offlineMode) return;
let errored = false;

Expand All @@ -782,14 +825,32 @@ const ChannelWithContext = <
loadInitialMessagesStateFromChannel(channel, channel.state.messagePagination.hasPrev);
}

if (client.user?.id && channel.state.read[client.user.id]) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { user, ...ownReadState } = channel.state.read[client.user.id];
setChannelUnreadState(ownReadState);
}

if (messageId) {
await loadChannelAroundMessage({ messageId, setTargetedMessage });
} else if (
initialScrollToFirstUnreadMessage &&
channel.countUnread() > scrollToFirstUnreadThreshold
client.user &&
unreadCount > scrollToFirstUnreadThreshold
) {
await loadChannelAtFirstUnreadMessage({ setTargetedMessage });
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { user, ...ownReadState } = channel.state.read[client.user.id];
await loadChannelAtFirstUnreadMessage({
channelUnreadState: ownReadState,
setChannelUnreadState,
setTargetedMessage,
});
}

if (unreadCount > 0 && markReadOnMount) {
await markRead({ updateChannelUnreadState: false });
}

listener = channel.on(handleEvent);
};

Expand Down Expand Up @@ -819,12 +880,12 @@ const ChannelWithContext = <
*/
useEffect(() => {
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
if (channel.cid === event.cid) copyChannelState();
if (channel.cid === event.cid) setRead(channel);
};

const { unsubscribe } = client.on('notification.mark_read', handleEvent);
return unsubscribe;
}, [channel.cid, client, copyChannelState]);
}, [channel, client, setRead]);

const threadPropsExists = !!threadProps;

Expand Down Expand Up @@ -858,23 +919,33 @@ const ChannelWithContext = <
/**
* CHANNEL METHODS
*/
const markRead: ChannelContextValue<StreamChatGenerics>['markRead'] = useRef(
throttle(
() => {
if (!channel || channel?.disconnected || !clientChannelConfig?.read_events) {
return;
}
const markRead: ChannelContextValue<StreamChatGenerics>['markRead'] = throttle(
async (options?: MarkReadFunctionOptions) => {
const { updateChannelUnreadState = true } = options ?? {};
if (!channel || channel?.disconnected || !clientChannelConfig?.read_events) {
return;
}

if (doMarkReadRequest) {
doMarkReadRequest(channel);
} else {
logChatPromiseExecution(channel.markRead(), 'mark read');
if (doMarkReadRequest) {
doMarkReadRequest(channel, updateChannelUnreadState ? setChannelUnreadState : undefined);
} else {
try {
const response = await channel.markRead();
if (updateChannelUnreadState && response && lastRead) {
setChannelUnreadState({
last_read: lastRead,
last_read_message_id: response?.event.last_read_message_id,
unread_messages: 0,
});
}
} catch (err) {
console.log('Error marking channel as read:', err);
}
},
defaultThrottleInterval,
throttleOptions,
),
).current;
}
},
defaultThrottleInterval,
throttleOptions,
);

const reloadThread = async () => {
if (!channel || !thread?.id) return;
Expand Down Expand Up @@ -1596,8 +1667,9 @@ const ChannelWithContext = <
overrideCapabilities: overrideOwnCapabilities,
});

const channelContext = useCreateChannelContext({
const channelContext = useCreateChannelContext<StreamChatGenerics>({
channel,
channelUnreadState,
disabled: !!channel?.data?.frozen,
EmptyStateIndicator,
enableMessageGroupingByUser,
Expand All @@ -1608,9 +1680,11 @@ const ChannelWithContext = <
!!(clientChannelConfig?.commands || [])?.some((command) => command.name === 'giphy'),
hideDateSeparators,
hideStickyDateHeader,
highlightedMessageId,
isChannelActive: shouldSyncChannel,
lastRead,
loadChannelAroundMessage,
loadChannelAtFirstUnreadMessage,
loading: channelMessagesState.loading,
LoadingIndicator,
markRead,
Expand All @@ -1620,6 +1694,7 @@ const ChannelWithContext = <
read: channelState.read ?? {},
reloadChannel,
scrollToFirstUnreadThreshold,
setChannelUnreadState,
setLastRead,
setTargetedMessage,
StickyHeader,
Expand Down Expand Up @@ -1748,6 +1823,7 @@ const ChannelWithContext = <
handleDelete,
handleEdit,
handleFlag,
handleMarkUnread,
handleMute,
handlePinMessage,
handleQuotedReply,
Expand Down Expand Up @@ -1815,6 +1891,7 @@ const ChannelWithContext = <
targetedMessage,
TypingIndicator,
TypingIndicatorContainer,
UnreadMessagesNotification,
updateMessage,
UrlPreview,
VideoThumbnail,
Expand Down
Loading
Loading