fix(network): network device hot-plugging#449
Open
ScarsTRF wants to merge 4 commits into
Open
Conversation
This is especially an issue with laptop devices such as a framework laptop with the ethernet card.
This should prevent any signals or devices from being touched on device add/remove.
Keep Network.wifi and Network.wired as stable wrapper objects instead of setting them to null when their backing NetworkManager device is missing. Add is_active to Wifi and Wired so users can tell whether the wrapper currently has a backing device while still binding to stable properties like icon-name.
|
@ScarsTRF is attempting to deploy a commit to the aylur's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes NetworkManager device not updating after hot-pluggin a network device in AstalNetwork.
Previously,
Network.wifiandNetwork.wiredwere only populated during initialization. Starting AGS/Astal before plugging in a USB Ethernet adapter or USB WiFi adapter and would leave the corresponding device object asnull.This updates the network module to refresh the relevant device wrapper when NetworkManager reports a device add/remove event. Wired-only events only refresh wired state, and WiFi-only events only refresh WiFi state.
This also keeps Network.wifi and Network.wired as stable wrapper objects instead of setting them to null when their device is missing making it easier for users to keep their bindings active if a device is removed or changed.
This also adds
is_activeto Wifi and Wired so users can check if the device is present on NetworkManager.Verification
nix build .#networkbuilds Astal fully.Network.wired/wifi.is_activeupdates fromfalsetotrueafter plugging in a Ethernet card.