diff --git a/packages/stream_chat/CHANGELOG.md b/packages/stream_chat/CHANGELOG.md index 349d6c00..347b3491 100644 --- a/packages/stream_chat/CHANGELOG.md +++ b/packages/stream_chat/CHANGELOG.md @@ -8,6 +8,7 @@ - [[#1047]](https://github.com/GetStream/stream-chat-flutter/issues/1047) `own_capabilities` extraData missing after channel update. - [[#1054]](https://github.com/GetStream/stream-chat-flutter/issues/1054) Fix `Unsupported operation: Cannot remove from an unmodifiable list`. +- [[#1033]](https://github.com/GetStream/stream-chat-flutter/issues/1033) Hard delete from dashboard does not delete message from client. ✅ Added 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) {