From f3c3e9583232eb4d6e19e399f4c12d82c4f5a4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 26 Nov 2026 02:30:40 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20messages=20sent=20quickly?= =?UTF-8?q?=20keep=20their=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui.rs | 2 ++ crates/client/src/gui/composer.rs | 2 ++ crates/client/src/gui/voice_note.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/crates/client/src/gui.rs b/crates/client/src/gui.rs index 05e2d8e..433e4e4 100644 --- a/crates/client/src/gui.rs +++ b/crates/client/src/gui.rs @@ -587,6 +587,7 @@ pub struct Yumush { backups: Vec, pending_backup_delete: Option, share_apps: Vec, + send_order: Arc>, } impl Yumush { @@ -645,6 +646,7 @@ impl Yumush { backups: Vec::new(), pending_backup_delete: None, share_apps: Vec::new(), + send_order: Default::default(), }; yumush.chat.camera_task = Some(camera_view::ticker(cx)); yumush diff --git a/crates/client/src/gui/composer.rs b/crates/client/src/gui/composer.rs index 1ce4fce..146fd6e 100644 --- a/crates/client/src/gui/composer.rs +++ b/crates/client/src/gui/composer.rs @@ -266,9 +266,11 @@ impl Yumush { let network = self.network.clone(); let restore = input.clone(); let pending = self.chat.media.pending.clone(); + let order = self.send_order.clone(); self.chat.drafts.remove(&community_id); cx.spawn_in(window, async move |this, cx| { + let _turn = order.lock().await; match network .call(CreateMessage { community_id, diff --git a/crates/client/src/gui/voice_note.rs b/crates/client/src/gui/voice_note.rs index e55568f..2d552a8 100644 --- a/crates/client/src/gui/voice_note.rs +++ b/crates/client/src/gui/voice_note.rs @@ -267,6 +267,7 @@ impl Yumush { .map(|settings| settings.max_attachment_bytes); cx.notify(); + let order = self.send_order.clone(); cx.spawn_in(window, async move |this, cx| { let Some(path) = cx .background_executor() @@ -282,6 +283,7 @@ impl Yumush { Ok(attachment) => attachment, Err(error) => return notify_error(&this, cx, error), }; + let _turn = order.lock().await; ok_or_notify( network .call(CreateMessage {