Service should watch the network itself; network-change policy moves out of the GUI #111

Closed
opened 2026-08-20 22:11:24 -04:00 by mysticalsoap · 1 comment
Owner

Successor to #89. That change made the service derive network facts at the point of use — but the network observer (monitor.NetMon: operstate watching, gateway checks, change detection) still runs in the GUI process, and the reactions to a change live in aqomui_gui.network_change: kill tunnels, reconnect last server, save_default_dns, re-trigger the bypass. All policy, none of it UI.

The gap this leaves: with the GUI closed, nobody watches the network. Unplug ethernet, switch Wi-Fi, resume from suspend — the service keeps dead tunnels, doesn't reconnect, doesn't rebuild the bypass, until a GUI process happens to start and its NetMon notices. Autoconnect-on-network-change is secretly a GUI feature.

Direction:

  • NetMon (or a successor) moves into the service; the service reacts to changes itself (teardown, reconnect-last per the autoconnect setting, bypass rebuild, DNS re-save) and emits a signal the GUI may observe.
  • The GUI keeps only genuine UI reactions driven by that signal: latency pings, status display.
  • The utils network cluster (default_routes, default_interface, preferred_interface) folds into the service-side observer module at that point — observer and fact-reader are the same concern, which is why a standalone netinfo.py was considered and rejected (2026-08-20 discussion).
  • network_change/service_recovered on the GUI side shrink accordingly; #24's tunnel-state single-source-of-truth is the companion direction.

Not 0.9.1 material; the provider-hookup release (0.9.2) is queued first.

Successor to #89. That change made the service derive network *facts* at the point of use — but the network *observer* (`monitor.NetMon`: operstate watching, gateway checks, change detection) still runs in the GUI process, and the *reactions* to a change live in `aqomui_gui.network_change`: kill tunnels, reconnect last server, `save_default_dns`, re-trigger the bypass. All policy, none of it UI. **The gap this leaves**: with the GUI closed, nobody watches the network. Unplug ethernet, switch Wi-Fi, resume from suspend — the service keeps dead tunnels, doesn't reconnect, doesn't rebuild the bypass, until a GUI process happens to start and its NetMon notices. Autoconnect-on-network-change is secretly a GUI feature. **Direction**: - NetMon (or a successor) moves into the service; the service reacts to changes itself (teardown, reconnect-last per the autoconnect setting, bypass rebuild, DNS re-save) and emits a signal the GUI *may* observe. - The GUI keeps only genuine UI reactions driven by that signal: latency pings, status display. - The utils network cluster (`default_routes`, `default_interface`, `preferred_interface`) folds into the service-side observer module at that point — observer and fact-reader are the same concern, which is why a standalone `netinfo.py` was considered and rejected (2026-08-20 discussion). - `network_change`/`service_recovered` on the GUI side shrink accordingly; #24's tunnel-state single-source-of-truth is the companion direction. Not 0.9.1 material; the provider-hookup release (0.9.2) is queued first.
Author
Owner

Correction to the gap claim: "with the GUI closed, nobody watches the network" overstates it. Minimized-to-tray (the normal post-#107 close) keeps the GUI process — and NetMon, and network_change — fully alive; and tray-menu Quit tears tunnels down by design, leaving nothing to watch. The gap only exists when the GUI process is absent while tunnels are up: a GUI crash (service-owned tunnels survive, unwatched), tunnels driven via aqomui-cli/D-Bus with no GUI, or headless operation.

The case for the move is therefore architectural rather than a daily-use bug: network-reaction policy (kill/reconnect/bypass rebuild) is root-service business currently executed from an unprivileged UI process; CLI usage gets no reactions at all; a crash strands live tunnels; and #24/#89's single-source-of-truth direction wants transitions initiated where the state lives. Priority unchanged (0.9.2+), urgency downgraded.

Correction to the gap claim: "with the GUI closed, nobody watches the network" overstates it. Minimized-to-tray (the normal post-#107 close) keeps the GUI *process* — and NetMon, and network_change — fully alive; and tray-menu Quit tears tunnels down by design, leaving nothing to watch. The gap only exists when the GUI process is absent while tunnels are up: a GUI crash (service-owned tunnels survive, unwatched), tunnels driven via aqomui-cli/D-Bus with no GUI, or headless operation. The case for the move is therefore architectural rather than a daily-use bug: network-reaction *policy* (kill/reconnect/bypass rebuild) is root-service business currently executed from an unprivileged UI process; CLI usage gets no reactions at all; a crash strands live tunnels; and #24/#89's single-source-of-truth direction wants transitions initiated where the state lives. Priority unchanged (0.9.2+), urgency downgraded.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#111
No description provided.