Extract the connect/reconnect decision into a Qt-free module #192
Loading…
Reference in a new issue
No description provided.
Delete branch "123-decision-module"
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?
Problem
The connect/reconnect decision lived inline in the gui (#123):
connect_last_serverparsedlast_server.jsoninto a mode,connection_established/connection_established_bypass/kill_bypasswrote it back, and none of it was reachable from the cli — which also meant a cli connect never recorded itself, so autoconnect ignored it. #191 needs the same decision reachable from the service.Fix
aqomui/decision.py(Qt-free, #83):reconnect_plan()parses the stored state into{main, hop, bypass}where main is replay / random-re-roll / profile-re-resolve;record_main/record_bypass/clear_bypassown the writes;random_serverandprofile_by_namecover the selection modes the catalog doesn't already.connect_last_servermaps the plan onto its existing actions (choose_random_server,connect_profile,establish_connection); progress bars, favourite button and hop widget stay put. The three recording sites become one-liners.--random,--random-favourite,--profile NAME, composing with--via. Tags match the gui's, so reconnect semantics carry: a favourite pick re-rolls, a profile re-resolves, a plain--randompick deliberately replays as the concrete server. The cli now records established connections, so autoconnect no longer forgets cli connects.Two deliberate edge changes: a failed random re-roll no longer leaves
ovpn_dictpointing at the stale stored dict, and a stored"bypass": nullis skipped instead of crashingestablish_connection.Verification
tests/test_decision.py(plan parsing incl. the present-but-off random marker, record/clear round-trips, selection helpers); full suite 481 passed.