Skip to content

prune network interfaces that no longer exist - #577

Merged
corecoding merged 2 commits into
corecoding:developfrom
ThorOdinson246:fix-557-minimal
Sep 5, 2026
Merged

corecoding merged 2 commits into
corecoding:developfrom
ThorOdinson246:fix-557-minimal

Conversation

@ThorOdinson246

Copy link
Copy Markdown
Contributor

Fixes #557.

The problem

Vitals never forgets a network interface. Once one disappears from /sys/class/net,
nothing removes it from _history, _networkSpeeds or _networkSpeedOffset.

Two effects:

  • The menu keeps listing interfaces that no longer exist.
  • Device rx/tx sums every entry in _networkSpeeds, so a dead interface's last speed keeps being counted.

The fix

When _queryNetwork sees an interface disappear, it reports 'destroy' for that sensor
through the normal callback. The same mechanism is used by a disabled sensor to report 'disabled'. extension.js handles it next to the existing 'disabled' check and drops the menu item, the hot item and the stored history.

A few notes on the choices, happy to change any of them:

  • Nothing is written to GSettings. hot-sensors is left alone, so a pinned interface comes
    back if it reappears rather than being silently unpinned.
  • Removal triggers on the interface being gone from /sys/class/net, not on it being down. So,
    a down interface keeps its directory, so toggling wifi does nothing here. I avoided matching
    on veth*/br-* names since that would hide real docker bridges.

Resolve the network query conflict by keeping the interface prune from this PR and leaving public-IP polling on develop's existing path.
@corecoding
corecoding changed the base branch from main to develop September 5, 2026 14:24
@corecoding
corecoding merged commit 1508f47 into corecoding:develop Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seems to remember every single network adapter, including ephemeral ones

2 participants