From 36dc4295fdcb4908fecbddbaf3b6c6bbe64dd39f Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 4 Apr 2022 11:04:41 +0200 Subject: [PATCH] fix(llc): remove hard delete messages from persistence storage --- packages/stream_chat/lib/src/client/channel.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/lib/src/client/channel.dart b/packages/stream_chat/lib/src/client/channel.dart index 7218cf65..7575b29d 100644 --- a/packages/stream_chat/lib/src/client/channel.dart +++ b/packages/stream_chat/lib/src/client/channel.dart @@ -1094,7 +1094,6 @@ class Channel { // remove the passed message if response does // not contain message state!.removeMessage(message); - await _client.chatPersistenceClient?.deleteMessageById(messageId); } return res; } @@ -1851,7 +1850,9 @@ class ChannelClientState { } /// Remove a [message] from this [channelState]. - void removeMessage(Message message) { + void removeMessage(Message message) async { + await _channel._client.chatPersistenceClient?.deleteMessageById(message.id); + final parentId = message.parentId; // i.e. it's a thread message, Remove it if (parentId != null) {