From 57d3f3bc6868c3849a76c88a60fd3939a50f7ef2 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Fri, 29 Oct 2021 18:36:41 +0200 Subject: [PATCH] Avoid race condition with TextFuture when setting message text Change-Id: I7de99faf565b73a67aceeaf646fec6e6d56123c8 --- .../features/home/room/detail/timeline/item/MessageTextItem.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt index afd239883b..6c76b1584d 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageTextItem.kt @@ -122,6 +122,8 @@ abstract class MessageTextItem : AbsMessageItem() { if (canUseTextFuture) { holder.messageView.setTextFuture(textFuture) } else { + // Remove possible previously set futures that might overwrite our text + holder.messageView.setTextFuture(null) holder.messageView.text = message } }