-
Notifications
You must be signed in to change notification settings - Fork 357
Cached messages are cleared from channels with unread messages when accessed while offline #2083
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
Open
1 task done
Labels
bug
Something isn't working
Comments
This issue is stale because it has been open for 20 days with no activity. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
This issue is stale because it has been open for 20 days with no activity. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
This issue is stale because it has been open for 20 days with no activity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which packages are you using?
stream_chat_flutter
On what platforms did you experience the issue?
iOS
What version are you using?
9.1.0
What happened?
In an app with Offline Support enabled, I attempted to read messages from a channel while offline. The channel had 1 new unread message. Upon attempting to load the channel, all messages were cleared from the state and the view failed to render. Channels without unread messages could still be read.
Steps to reproduce
Supporting info to reproduce
This appears to be caused by the following line in the _queryAtTimestamp method of StreamChannelState:
channel.state!.truncate();
I also believe there may be larger issues with this flow, as 'channel.state!.isUpToDate = false;' being called there prevents the markReadWhenAtTheBottom parameter from functioning as expected due to line 1524 of message_list_view.dart 'if (_upToDate && allowMarkRead && canMarkReadAtBottom) {' being triggered before isUpToDate is ever set back to true.
Relevant log output
Flutter analyze output
Flutter doctor output
Code of Conduct
The text was updated successfully, but these errors were encountered: