From 2810cd35625f861c7ed981097c22e6c10cfc7d00 Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Fri, 10 Jul 2026 03:16:42 +0300 Subject: [PATCH 1/2] fix(infrastructure): trigger network "no traffic" notice on interface name only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The notice at the top of the network charts was firing whenever the aggregated per-second delta was zero across all interfaces. That is a false positive when Capture is running on a real host but the polling interval is >= 1 minute and the aggregation bucket is also 1 minute — first == last in the bucket, delta is zero, but the interface has plenty of real traffic in its cumulative counters. Base the notice on interface names instead: only show it when the ONLY interfaces Capture reports are loopback / container-bridge names (lo, lo0, docker0). Real NICs (enp0s6, eth0, wlan0, tunN, vethN, brN, etc.) keep the notice hidden even when the aggregation currently reports zero throughput. The underlying zero-throughput bug (single-sample buckets producing zero deltas) is tracked separately. --- .../Details/Components/ChartsNetwork.tsx | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx b/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx index c7ebac5be..dfb485a2b 100644 --- a/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx @@ -63,10 +63,20 @@ const getChartConfigs = ( return configs; }; -const hasAnyNetworkTraffic = (checks: HardwareCheckStats[]): boolean => - checks.some((c) => - c.net?.some((iface) => iface.bytesSentPerSecond > 0 || iface.deltaBytesRecv > 0) - ); +// Loopback / bridge names Capture sees when it can only observe the container's +// own network namespace. When ALL reported interfaces match this set we assume +// the "no real interfaces visible" case and surface the notice. +const CONTAINER_ONLY_IFACE_NAMES = new Set(["lo", "lo0", "docker0"]); + +const onlyContainerVisibleInterfaces = (checks: HardwareCheckStats[]): boolean => { + const named = new Set(); + checks.forEach((c) => c.net?.forEach((iface) => named.add(iface.name))); + if (named.size === 0) return false; + for (const name of named) { + if (!CONTAINER_ONLY_IFACE_NAMES.has(name)) return false; + } + return true; +}; export const InfraNetworkCharts = ({ checks, @@ -82,7 +92,8 @@ export const InfraNetworkCharts = ({ () => getChartConfigs(theme, checks, t), [theme, checks, t] ); - const showNoTrafficNotice = chartConfigs.length > 0 && !hasAnyNetworkTraffic(checks); + const showNoTrafficNotice = + chartConfigs.length > 0 && onlyContainerVisibleInterfaces(checks); return ( From 77b817778b6dc24a7a47fcb6bad1febf7a43f6cc Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Sat, 11 Jul 2026 04:29:22 +0300 Subject: [PATCH 2/2] address review feedback: rename notice to match new trigger The notice now triggers on interface names (loopback / container-bridge only), not on zero traffic. Update the variable, i18n key, and English copy to match: - showNoTrafficNotice -> showLoopbackOnlyNotice - pages.infrastructure.charts.labels.netNoTraffic -> pages.infrastructure.charts.labels.loopbackOnlyNotice - English string rewritten to describe the loopback-only condition rather than "zero traffic on every interface" Other locales still hold the old string under the old key and will fall back to English until the translation pipeline picks up the new key. Tracked separately. --- .../Infrastructure/Details/Components/ChartsNetwork.tsx | 6 +++--- client/src/locales/en.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx b/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx index dfb485a2b..c84a327fa 100644 --- a/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/ChartsNetwork.tsx @@ -92,14 +92,14 @@ export const InfraNetworkCharts = ({ () => getChartConfigs(theme, checks, t), [theme, checks, t] ); - const showNoTrafficNotice = + const showLoopbackOnlyNotice = chartConfigs.length > 0 && onlyContainerVisibleInterfaces(checks); return ( - {showNoTrafficNotice && ( + {showLoopbackOnlyNotice && ( - {t("pages.infrastructure.charts.labels.netNoTraffic")} + {t("pages.infrastructure.charts.labels.loopbackOnlyNotice")} )}