Skip to content

monitoring: no shutdown mechanism, misses hotplug, always returns Err #353

@cachebag

Description

@cachebag

three related issues with monitor_network_changes and monitor_device_changes:

no way to stop monitors

both functions create a watch::channel internally but never expose the sender. there's no public api to gracefully shut down monitoring — the only way out is dropping the task.

wifi hotplug missed

monitor_network_changes subscribes to wifi devices present at startup. a usb wifi adapter plugged in later won't have its AP change signals picked up — there's no DeviceAdded handler to attach new NMWirelessProxy streams.

exit is always an error

both monitors always return Err(ConnectionError::Stuck("monitoring stream ended")) regardless of why they stopped (monitoring/network.rs:88-108, monitoring/device.rs:82-102). callers can't distinguish a clean stop from a real failure.

there's also a redundant while let Some drain loop after the main select! loop that fires callbacks after the shutdown signal was already received.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmonitoringConnection monitoring and infonmrsChanges to nmrs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions