From bac29d959d3262192c4de2041df39404ca614592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Sun, 1 Jun 2025 18:01:21 +0200 Subject: [PATCH] fix: no user feedback if client.getConfig() takes some time When sending a file in an environment with bad internet where Client.getConfig() takes some seconds, the user does not get any feedback at all. This change now makes sure that the user always sees the pending event in the timeline before anything else is done in the room.sendFileEvent method. --- lib/src/room.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index 500e0aee..c3efce20 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -771,6 +771,7 @@ class Room { }, ), ); + await _handleFakeSync(syncUpdate); MatrixFile uploadFile = file; // ignore: omit_local_variable_types // computing the thumbnail in case we can @@ -779,7 +780,6 @@ class Room { syncUpdate.rooms!.join!.values.first.timeline!.events!.first .unsigned![fileSendingStatusKey] = FileSendingStatus.generatingThumbnail.name; - await _handleFakeSync(syncUpdate); thumbnail ??= await file.generateThumbnail( nativeImplementations: client.nativeImplementations, customImageResizer: client.customImageResizer,