Skip to content

network(networkmanager): refresh wired profiles on settings changes - #3929

Merged
bbedward merged 1 commit into
duxlabs-dev:masterfrom
KadirJeager:fix/nm-wired-profile-refresh
Oct 26, 2026
Merged

bbedward merged 1 commit into
duxlabs-dev:masterfrom
KadirJeager:fix/nm-wired-profile-refresh

Conversation

@KadirJeager

Copy link
Copy Markdown
Contributor

Description

Deleted wired profiles kept showing in the network settings and the control center until the shell was restarted.

handleDBusSignal refreshes the VPN, Wi-Fi, hotspot and cellular lists on Settings.NewConnection, Settings.ConnectionRemoved and Settings.Connection.Updated, but not the wired profile list. The wired list is otherwise only rebuilt on a device State change, and adding or deleting an inactive wired profile changes no device state. This is common with USB tethering and USB Ethernet adapters: NetworkManager keeps one "Wired connection N" profile per interface name, and the name depends on the USB port.

This PR calls listEthernetConnections() in that handler. It also makes listEthernetConnections() get its settings handle through networkManagerSettings(). The old code shadowed the new handle inside the if s == nil block, so it asserted on a nil interface whenever the cached handle was unset.

#3727 makes the same one-line handler change as part of the larger connection editor work. This PR is only the bug fix, so it can land on its own. If #3727 merges first, this one can be closed.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Related issues

Related: #3727

Screenshots / video

No visual change. The existing list now updates when profiles are added or removed.

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • Go changes: ran gofmt, added/updated tests, go test ./... passes in core/, and go mod tidy is clean

Testing

  • New TestNetworkManagerBackend_HandleDBusSignal_ConnectionRemovedRefreshesWiredConnections: starts with a stale wired list, sends ConnectionRemoved, and checks that only the remaining profile is listed. It fails without the fix.
  • New TestNetworkManagerBackend_ListEthernetConnections_InvalidSettingsHandle: panicked before the fix, now returns an error.
  • go vet and go test ./... pass in core/.
  • Live test on Arch (NetworkManager 1.58.1) with the same patch on v1.6.2: nmcli connection add type ethernet ... autoconnect no showed up in the wired list right away, and nmcli connection delete removed it, with no shell restart.

🤖 Generated with Claude Code

NewConnection, ConnectionRemoved and Updated refreshed the VPN, Wi-Fi,
hotspot and cellular lists but not the wired profile list. Adding or
deleting an inactive wired profile does not change any device state, so
the list stayed stale until the shell restarted and deleted profiles
kept showing in the network settings and control center.

listEthernetConnections now also resolves the settings handle through
networkManagerSettings(); the old code shadowed the new handle and
asserted on a nil interface when the cached handle was unset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Claude review

Looks good: the fix is correct and small.
No issues found.
Checked: listEthernetConnections now uses networkManagerSettings(), which removes the nil-interface panic from the shadowed s. Also checked the new refresh in the Settings signal handler against the other callers and locking (it takes stateMutex only around the state write, so no deadlock), and the two new tests. Model: claude-opus-5-5.

@bbedward
bbedward merged commit cb20e89 into duxlabs-dev:master Oct 26, 2026
3 checks passed
dux-ci Bot pushed a commit that referenced this pull request Oct 26, 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.

3 participants