Skip to content

Commit 96c679f

Browse files
authored
Editing quoted messages did not refresh the message list (#536)
1 parent 609135b commit 96c679f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Sources/StreamChatSwiftUI/Utils/MessageCachingUtils.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ class MessageCachingUtils {
6464
}
6565

6666
func quotedMessage(for message: ChatMessage) -> ChatMessage? {
67+
if StreamRuntimeCheck._isDatabaseObserverItemReusingEnabled {
68+
return message.quotedMessage
69+
}
70+
6771
if checkedMessageIds.contains(message.id) {
6872
return nil
6973
}

StreamChatSwiftUITests/Tests/ChatChannel/MessageCachingUtils_Tests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ class MessageCachingUtils_Tests: StreamChatTestCase {
2525
author: author
2626
)
2727
)
28+
29+
private var initialReusingState = false
30+
31+
override func setUpWithError() throws {
32+
initialReusingState = StreamRuntimeCheck._isDatabaseObserverItemReusingEnabled
33+
StreamRuntimeCheck._isDatabaseObserverItemReusingEnabled = false
34+
}
35+
36+
override func tearDownWithError() throws {
37+
StreamRuntimeCheck._isDatabaseObserverItemReusingEnabled = initialReusingState
38+
}
2839

2940
func test_messageCachingUtils_authorId() {
3041
// Given

0 commit comments

Comments
 (0)