From b09c80897177c9aa3c04f029c5afa4ab52464b40 Mon Sep 17 00:00:00 2001 From: riccardom Date: Wed, 29 Jul 2026 18:11:57 +0200 Subject: [PATCH] [client] wait for macOS UI launch and propagate its error Replace Start()+Process.Release() with Run() in startUIAsUser: the launchctl/sudo/open chain is short-lived (open returns once LaunchServices accepts the request), so waiting surfaces a launch failure to the caller instead of swallowing it. Addresses CodeRabbit review. --- client/internal/updater/installer/installer_run_darwin.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/internal/updater/installer/installer_run_darwin.go b/client/internal/updater/installer/installer_run_darwin.go index f67680774..5650bc769 100644 --- a/client/internal/updater/installer/installer_run_darwin.go +++ b/client/internal/updater/installer/installer_run_darwin.go @@ -113,12 +113,8 @@ func (u *Installer) startUIAsUser() error { launchCmd := exec.Command("launchctl", "asuser", userInfo.Uid, "sudo", "-u", username, "-H", "open", "-a", uiBinary) log.Infof("launchCmd: %s", launchCmd.String()) - if err := launchCmd.Start(); err != nil { - return fmt.Errorf("start UI process: %w", err) - } - - if err := launchCmd.Process.Release(); err != nil { - log.Warnf("failed to release UI process: %v", err) + if err := launchCmd.Run(); err != nil { + return fmt.Errorf("run UI launch: %w", err) } log.Infof("netbird-ui started successfully for user %s", username)