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

Fix events not processed when version equals to stored #824

Merged
merged 21 commits into from
Feb 28, 2024
Merged
Changes from 4 commits
Commits
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
9 changes: 9 additions & 0 deletions lib/store/chat_rx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,15 @@ class HiveRxChat extends RxChat {
}

_lastReadItemCursor = node.chat.lastReadItemCursor;

// TODO: Remove, when all events are surely delivered by subscribing to
// `chatEvents` with version.
if (hasNext.isFalse &&
node.chat.value.lastItem != null &&
messages.none((e) => e.value.id == node.chat.value.lastItem!.id)) {
_pagination.hasNext.value = true;
await _pagination.next();
}
krida2000 marked this conversation as resolved.
Show resolved Hide resolved
krida2000 marked this conversation as resolved.
Show resolved Hide resolved
break;

case ChatEventsKind.event:
Expand Down
Loading