From d1d44afc9dcbc7ff219f588e8299eeb43c68364b Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sun, 8 Mar 2026 19:37:04 +0100 Subject: [PATCH] Update notification service --- AppImage/components/storage-overview.tsx | 6 +++--- AppImage/scripts/notification_events.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/AppImage/components/storage-overview.tsx b/AppImage/components/storage-overview.tsx index 32babbf4..0d25558d 100644 --- a/AppImage/components/storage-overview.tsx +++ b/AppImage/components/storage-overview.tsx @@ -1046,11 +1046,11 @@ export function StorageOverview() {
Size -

{disk.size || "N/A"}

+

{disk.size_formatted || disk.size || "N/A"}

SMART Status -

{disk.smart_status || "N/A"}

+

{disk.smart_status || "N/A"}

{disk.serial && disk.serial !== "Unknown" && (
@@ -1314,7 +1314,7 @@ export function StorageOverview() {
{/* Observations Section */} - {(diskObservations.length > 0 || loadingObservations) && ( + {(diskObservations.length > 0 || loadingObservations || (selectedDisk.observations_count ?? 0) > 0) && (

diff --git a/AppImage/scripts/notification_events.py b/AppImage/scripts/notification_events.py index 25afe0a7..843ab081 100644 --- a/AppImage/scripts/notification_events.py +++ b/AppImage/scripts/notification_events.py @@ -804,6 +804,13 @@ class JournalWatcher: raw_message=raw_msg, severity='warning', ) + + # Also update worst_health so the disk stays marked as warning + # even if current SMART readings show 0 pending sectors + warn_line_text = warn_line_m.group(1).strip() if warn_line_m else error_signature + health_persistence.update_disk_worst_health( + base_dev, serial, 'warning', warn_line_text + ) except Exception as e: print(f"[DiskIOEventProcessor] Error recording smartd observation: {e}") @@ -1795,6 +1802,18 @@ class PollingCollector: except Exception: pass + # Skip recovery notifications for SMART disk errors (pending/reallocated sectors). + # These indicate physical disk degradation that doesn't truly "recover" -- + # the disk may show 0 pending sectors later but the damage history persists. + # The worst_health in disk_registry tracks this, so we don't send false "resolved". + if category == 'disks': + reason_lower = reason.lower() if reason else '' + if any(indicator in reason_lower for indicator in [ + 'pending', 'reallocated', 'sector', 'smart', 'unreadable' + ]): + self._last_notified.pop(key, None) + continue + # Calculate duration duration = '' if first_seen: