Skip to content

fix(#523): dont error when VPN is disconnected externally - #526

Merged
cachebag merged 1 commit into
masterfrom
fix/vpn-dbus-err
Aug 7, 2026
Merged

fix(#523): dont error when VPN is disconnected externally#526
cachebag merged 1 commit into
masterfrom
fix/vpn-dbus-err

Conversation

@cachebag

@cachebag cachebag commented Aug 7, 2026

Copy link
Copy Markdown
Member

get_vpn_info() read the active connections state, devices, interface, and IP config with raw ?. When a VPN is torn down externally (e.g. disconnected from another app) while being read, those objects vanish mid-read and NetworkManager returns an UnknownObject/UnknownInterface D-Bus error, which surfaced downstream (COSMIC Settings) as "a VPN interface does not exist".

Treat missing-object reads as the VPN no longer being active (NoVpnConnection) and degrade interface/IP details gracefully, matching the existing vanish-handling in list_active_connections. Expose is_missing_dbus_object_error as pub(crate) and add a vanished_or_err helper with unit tests.

Closes #523

get_vpn_info() read the active connections state, devices, interface,
and IP config with raw `?`. When a VPN is torn down externally (e.g.
disconnected from another app) while being read, those objects vanish
mid-read and NetworkManager returns an UnknownObject/UnknownInterface
D-Bus error, which surfaced downstream (COSMIC Settings) as "a VPN
interface does not exist".

Treat missing-object reads as the VPN no longer being active
(NoVpnConnection) and degrade interface/IP details gracefully, matching
the existing vanish-handling in list_active_connections. Expose
is_missing_dbus_object_error as pub(crate) and add a vanished_or_err
helper with unit tests.
@cachebag cachebag self-assigned this Aug 7, 2026
@cachebag cachebag added bug Something isn't working vpn Changes to VPN surface dbus D-Bus types, signatures, or NM D-Bus API monitoring Connection monitoring and info labels Aug 7, 2026
@cachebag
cachebag deployed to self-hosted-pr-integration August 7, 2026 03:21 — with GitHub Actions Active
@cachebag
cachebag merged commit 03714db into master Aug 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dbus D-Bus types, signatures, or NM D-Bus API monitoring Connection monitoring and info vpn Changes to VPN surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error message appears when VPN is disconnected

1 participant