From 3e3d3f0c2b04681e09696990b2214d4873fb5cfe Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 6 Nov 2025 12:04:49 +0100 Subject: [PATCH] Fix Tab key 1-second delay by reverting ZMQ to non-blocking mode - Change receive_metrics() from blocking to DONTWAIT to prevent main loop freezing - Eliminate 1-second ZMQ socket timeout that was blocking UI after Tab key press - Main loop now continues immediately after immediate render instead of waiting - Maintain heartbeat-based host detection while fixing visual responsiveness - Fix blocking operation introduced when implementing heartbeat timeout mechanism - Tab navigation now truly immediate without any network operation delays - Bump version to 0.1.61 --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- dashboard/Cargo.toml | 2 +- dashboard/src/communication/mod.rs | 4 ++-- shared/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f935ef..04d91b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.59" +version = "0.1.60" dependencies = [ "anyhow", "chrono", @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.59" +version = "0.1.60" dependencies = [ "anyhow", "async-trait", @@ -315,7 +315,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.59" +version = "0.1.60" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 36ac9e4..c84c186 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.60" +version = "0.1.61" edition = "2021" [dependencies] diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index a6392d0..0c7d136 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.60" +version = "0.1.61" edition = "2021" [dependencies] diff --git a/dashboard/src/communication/mod.rs b/dashboard/src/communication/mod.rs index 4ffb01a..2d9688d 100644 --- a/dashboard/src/communication/mod.rs +++ b/dashboard/src/communication/mod.rs @@ -141,9 +141,9 @@ impl ZmqConsumer { } } - /// Receive metrics from any connected agent (with timeout) + /// Receive metrics from any connected agent (non-blocking) pub async fn receive_metrics(&mut self) -> Result> { - match self.subscriber.recv_bytes(0) { + match self.subscriber.recv_bytes(zmq::DONTWAIT) { Ok(data) => { debug!("Received {} bytes from ZMQ", data.len()); diff --git a/shared/Cargo.toml b/shared/Cargo.toml index cb95214..91a8426 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.60" +version = "0.1.61" edition = "2021" [dependencies]