fix(mac): harden remote tunnel recovery

This commit is contained in:
Peter Steinberger
2026-01-03 00:02:27 +01:00
parent 88ed58b3d0
commit 9dd613edf7
7 changed files with 108 additions and 3 deletions

View File

@@ -204,6 +204,16 @@ struct MenuContent: View {
} label: {
Label("Send Test Heartbeat", systemImage: "waveform.path.ecg")
}
if self.state.connectionMode == .remote {
Button {
Task { @MainActor in
let result = await DebugActions.resetGatewayTunnel()
self.presentDebugResult(result, title: "Remote Tunnel")
}
} label: {
Label("Reset Remote Tunnel", systemImage: "arrow.triangle.2.circlepath")
}
}
Button {
Task { _ = await DebugActions.toggleVerboseLoggingMain() }
} label: {
@@ -462,6 +472,21 @@ struct MenuContent: View {
return "System default"
}
@MainActor
private func presentDebugResult(_ result: Result<String, DebugActionError>, title: String) {
let alert = NSAlert()
alert.messageText = title
switch result {
case let .success(message):
alert.informativeText = message
alert.alertStyle = .informational
case let .failure(error):
alert.informativeText = error.localizedDescription
alert.alertStyle = .warning
}
alert.runModal()
}
@MainActor
private func loadMicrophones(force: Bool = false) async {
guard self.showVoiceWakeMicPicker else {