fix(proxy): unify node switching and connection cleanup (#8592)

Route frontend and tray node selections through the same backend flow for
selection, persistence, state refresh, and connection cleanup. Read the
group's previous selection before switching and preserve the original
rule of closing only connections whose chains contain that selection.

Run optional cleanup in the background and keep its failures separate
from successful selection. Remove redundant frontend effects and unused
IPC commands, and refresh the proxy view for every successful switch.

Refs: 32095daf90
Refs: bea0dde074
This commit is contained in:
Tunglies
2026-11-09 14:28:44 +00:00
committed by GitHub
parent 7764289ba5
commit 05a6e9a64f
12 changed files with 115 additions and 255 deletions
+3 -1
View File
@@ -1000,7 +1000,9 @@ fn on_menu_event(_: &AppHandle, event: MenuEvent) {
Some((g, p)) => (g, p),
None => return,
};
feat::switch_proxy_node(group_name, proxy_name).await;
if let Err(err) = feat::switch_proxy_node(group_name, proxy_name, false).await {
logging!(error, Type::Tray, "Failed to switch proxy: {err:#}");
}
}
_ => {
logging!(debug, Type::Tray, "Unhandled tray menu event: {:?}", event.id);