recover the gui's D-Bus proxy when the service restarts underneath it #80
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/stale-dbus-proxy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #73. Stacked on #79 (
change/tunnel-state) — the recovery path re-syncs through itsget_tunnel_state. Merge order: #79 first.Problem
The GUI resolved its D-Bus proxy once at startup, and dbus-python pins such a proxy to the unique bus name of whoever owned
org.aqomui.serviceat that moment. A service restart (package upgrade, crash recovery, manualsystemctl restart) hands the well-known name to a new unique name, so the next GUI action failed withServiceUnknownand got misread as "service is not available" — dialog plus a needless polkit-prompted restart of a service that was already up.Fix
get_object(..., follow_name_owner_changes=True): the proxy (and its signal matches) now tracks the well-known name across restarts, so calls after a completed restart just work.dbus_callnow waits up to 5s for the name to have an owner again; if it does, it re-registers what the GUI owns (bypass network info), re-syncs the tunnel state, and retries the call once — silently. The dialog is reserved for a name nobody owns, and its Restart path now runs the same recovery.create_dbus_objectis idempotent: it removes its previous signal matches before reconnecting. This also fixes a pre-existing double-subscription — the service-down-at-startup path calledcreate_dbus_objecttwice (once viainitialize_service, once from__init__), leaving every log line handled twice.name_has_ownerinstead of a throwawayget_object, andinitialize_serviceno longer builds a redundant proxy thatcreate_dbus_objectimmediately rebuilds.Verification
ruff check --select E9,F63,F7,F82andcompileall -W error::SyntaxWarningclean.systemctl restart aqomui→ next GUI action should produce no dialog and no polkit prompt, log lines should appear once (not doubled), and with bypass enabled the cgroup rules should survive the restart via the automatic re-register.🤖 Generated with Claude Code
00ea8f16688b79d40350