Faster scrolling in the channel list page leads loadMoreIndicatorBuilder() to be displayed forever without displaying new paginated data.
Expected behaviour would be that the newly received paginated data should be displayed without any hiccups.
Steps to reproduce
1. Clone the example from stream_chat_flutter repo.
2. Run/debug the project with and without StreamChatPersistenceClient initialised.
3. Without the StreamChatPersistenceClient, scrolling fast in channel/chat list works fine.
Supporting info to reproduce
Further debugging led me to believe that the issue lies within getChannelStates() function of the StreamChatPersistenceClient. Starting at line 284 in stream_chat_persistence_client.dart,
final offset = paginationParams?.offset;
if (offset != null && offset > 0 && channelStates.isNotEmpty) {
channelStates.removeRange(0, offset);
}
Occasionally, offset value is greater than channelStates.length, which leads to range error for channelStates.removeRange().
I believe this has something to do with the data fetched from DriftDatabase/moor. I tried logging channelStates.length and offset value, hence the range error:
Which packages are you using?
stream_chat_flutter, stream_chat_persistance
On what platforms did you experience the issue?
iOS, Android
What version are you using?
stream_chat_persistence: 8.1.0 stream_chat_flutter: 8.1.0
What happened?
Faster scrolling in the channel list page leads loadMoreIndicatorBuilder() to be displayed forever without displaying new paginated data.
Expected behaviour would be that the newly received paginated data should be displayed without any hiccups.
Steps to reproduce
Supporting info to reproduce
Further debugging led me to believe that the issue lies within getChannelStates() function of the StreamChatPersistenceClient. Starting at line 284 in stream_chat_persistence_client.dart,
Occasionally, offset value is greater than channelStates.length, which leads to range error for channelStates.removeRange().
I believe this has something to do with the data fetched from DriftDatabase/moor. I tried logging channelStates.length and offset value, hence the range error:
https://github.com/user-attachments/assets/2a7dcff0-b68d-4d50-a96b-7da744af0875
Relevant log output
No response
Flutter analyze output
No response
Flutter doctor output
No response
Code of Conduct