Hi
I am using sendbird-flutter SDK v 3.1.7.
When I use message threading and reply to a parent message, I can see the reply thread. I have tested this by loggong in on two emulators, and replying to a message sent from the first emulator in the second emulator in a thread. However, when I then do a query to load channel messages, none of the messages which have a parent message are retrieved:
The code I am using to retrieve the channel messages is:
Future<void> loadMessages({
int? timestamp,
bool reload = false,
}) async {
if (isLoading) {
return;
}
isLoading = true;
final ts = reload ? DateTime.now().millisecondsSinceEpoch : timestamp!;
try {
final params = MessageListParams()
..includeThreadInfo = true
..includeReplies = true
..isInclusive = false
..includeParentMessageText = true
..reverse = true
..previousResultSize = 20;
final messages = await channel!.getMessagesByTimestamp(ts, params);
_messages = reload ? messages : _messages + messages;
for(BaseMessage message in _messages) {
print("PARENT: ${message.parentMessageId
}, ORIGINAL: ${message.message}");
}
print('PARENT LAST MSG: ${channel!.lastMessage!.parentMessageId} CHANNEL MESSAGE LAST: ${channel!.lastMessage!.message}');
hasNext = messages.length == 20;
isLoading = false;
if (!isDisposed) notifyListeners();
} catch (e) {
isLoading = false;
print('group_channel_view.dart: getMessages: ERROR: $e');
}
}
The print statements are just to highlight the difference when channel!.lastMessage has a parent it doesn’t appear in the results of the query