diff --git a/Cargo.lock b/Cargo.lock index a6db155..d378998 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.46" +version = "0.1.47" dependencies = [ "anyhow", "chrono", @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.46" +version = "0.1.47" dependencies = [ "anyhow", "async-trait", @@ -314,7 +314,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.46" +version = "0.1.47" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 3c445b8..0837e93 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.47" +version = "0.1.48" edition = "2021" [dependencies] diff --git a/agent/src/status/mod.rs b/agent/src/status/mod.rs index b6aaada..6f6ada8 100644 --- a/agent/src/status/mod.rs +++ b/agent/src/status/mod.rs @@ -272,11 +272,13 @@ impl HostStatusManager { /// Check if a status change is significant enough for notification fn is_significant_change(&self, old_status: Status, new_status: Status) -> bool { match (old_status, new_status) { - // Always notify on problems + // Don't notify on transitions from Unknown (startup/restart scenario) + (Status::Unknown, _) => false, + // Always notify on problems (but not from Unknown) (_, Status::Warning) | (_, Status::Critical) => true, // Only notify on recovery if it's from a problem state to OK and all services are OK (Status::Warning | Status::Critical, Status::Ok) => self.current_host_status == Status::Ok, - // Don't notify on startup or other transitions + // Don't notify on other transitions _ => false, } } @@ -374,8 +376,8 @@ impl HostStatusManager { details.push('\n'); } - // Show recoveries - if !recovery_changes.is_empty() { + // Show recoveries only if host status is now OK (all services recovered) + if !recovery_changes.is_empty() && aggregated.host_status_final == Status::Ok { details.push_str(&format!("✅ RECOVERIES ({}):\n", recovery_changes.len())); for change in recovery_changes { details.push_str(&format!(" {}\n", change)); diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 5f85797..fec138a 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.47" +version = "0.1.48" edition = "2021" [dependencies] diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 3aa91b1..f77f2c7 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.47" +version = "0.1.48" edition = "2021" [dependencies]