File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
packages/stream_chat_flutter_core Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 11## Upcoming
22
3+ 🐞 Fixed
4+
5+ - Fixed an issue with ` StreamChannel ` where loading channel at ` lastReadMessageId ` might fail
6+ if the channel exceeds the member threshold. This is now handled gracefully by falling back to loading
7+ the channel at the ` lastRead ` date.
8+
39🔄 Changed
410
511- Updated ` freezed_annotation ` dependency to ` ">=2.4.1 <4.0.0" ` .
Original file line number Diff line number Diff line change @@ -508,7 +508,16 @@ class StreamChannelState extends State<StreamChannel> {
508508
509509 // Load the channel at the last read message if available.
510510 if (currentUserRead.lastReadMessageId case final lastReadMessageId? ) {
511- return loadChannelAtMessage (lastReadMessageId);
511+ try {
512+ return await loadChannelAtMessage (lastReadMessageId);
513+ } catch (e) {
514+ // If the loadChannelAtMessage for any reason fails, we fallback to
515+ // loading the channel at the last read date.
516+ //
517+ // One example of this is when the channel becomes too large and
518+ // exceeds a certain threshold (I believe it's a 1000 members) it
519+ // can't update the readstate anymore for each individual member.
520+ }
512521 }
513522
514523 // Otherwise, load the channel at the last read date.
You can’t perform that action at this time.
0 commit comments