[PR #6856] client: explain unavailable daemon on connect #29964

Open
opened 2026-08-05 08:09:32 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6856
Author: @core3750x
Created: 7/22/2026
Status: 🔄 Open

Base: mainHead: fix/daemon-unavailable-connect-feedback


📝 Commits (1)

  • de053d4 client: explain unavailable daemon on connect

📊 Changes

4 files changed (+60 additions, -4 deletions)

View changed files

📝 client/ui/frontend/src/modules/main/MainConnectionStatusSwitch.tsx (+7 -1)
📝 client/ui/i18n/locales/en/common.json (+12 -0)
📝 client/ui/tray.go (+24 -3)
client/ui/tray_connect_test.go (+17 -0)

📄 Description

Describe your changes

When the desktop UI detects DaemonUnavailable, clicking the primary connection control currently does nothing:

  • the tray hides and disables Connect;
  • the main Wails UI explicitly returns from handleSwitch without feedback.

This change keeps Connect visible and enabled in the tray and provides an actionable, localized error in both the tray and main window. Users are told that the NetBird system service is not running and should be started or restarted before retrying.

The patch intentionally does not add a new privilege-elevation path to the user-session GUI. Automatically bootstrapping a root LaunchDaemon needs separate platform/security design; this fixes the confirmed silent no-op while keeping existing privilege boundaries intact.

Triage discussion: https://github.com/netbirdio/netbird/discussions/6855

The repository now requires Discussion-first validation before a community issue can be created.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description).

By submitting this pull request, I confirm that I have read and agree to the terms of the Contributor License Agreement.

Validation

  • pnpm check
  • pnpm build
  • go test ./client/ui/...

Documentation

  • I added/updated documentation for this change
  • Documentation is not needed for this change: this restores user-visible feedback for an existing error state and adds no new configuration or workflow.

Docs PR URL

N/A


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling when the background service is unavailable during connection attempts.
    • The Connect option remains available so users can receive clear error feedback instead of an unsuccessful connection attempt.
  • New Features

    • Added localized error messages explaining that the background service could not be reached and providing actionable guidance.
    • Added a dedicated connection error dialog for this condition.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/6856 **Author:** [@core3750x](https://github.com/core3750x) **Created:** 7/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/daemon-unavailable-connect-feedback` --- ### 📝 Commits (1) - [`de053d4`](https://github.com/netbirdio/netbird/commit/de053d440c3c50c0edba09db061a9fcc675c817d) client: explain unavailable daemon on connect ### 📊 Changes **4 files changed** (+60 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `client/ui/frontend/src/modules/main/MainConnectionStatusSwitch.tsx` (+7 -1) 📝 `client/ui/i18n/locales/en/common.json` (+12 -0) 📝 `client/ui/tray.go` (+24 -3) ➕ `client/ui/tray_connect_test.go` (+17 -0) </details> ### 📄 Description ## Describe your changes When the desktop UI detects `DaemonUnavailable`, clicking the primary connection control currently does nothing: - the tray hides and disables Connect; - the main Wails UI explicitly returns from `handleSwitch` without feedback. This change keeps Connect visible and enabled in the tray and provides an actionable, localized error in both the tray and main window. Users are told that the NetBird system service is not running and should be started or restarted before retrying. The patch intentionally does not add a new privilege-elevation path to the user-session GUI. Automatically bootstrapping a root LaunchDaemon needs separate platform/security design; this fixes the confirmed silent no-op while keeping existing privilege boundaries intact. ## Issue ticket number and link Triage discussion: https://github.com/netbirdio/netbird/discussions/6855 The repository now requires Discussion-first validation before a community issue can be created. ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) - [x] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). > By submitting this pull request, I confirm that I have read and agree to the terms of the Contributor License Agreement. ## Validation - `pnpm check` - `pnpm build` - `go test ./client/ui/...` ## Documentation - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change: this restores user-visible feedback for an existing error state and adds no new configuration or workflow. ### Docs PR URL N/A <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/netbirdio/codesmith/netbird/pr/6856"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with Codesmith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1787298754&installation_model_id=427504&pr_number=6856&repository=netbirdio%2Fnetbird&return_to=https%3A%2F%2Fgithub.com%2Fnetbirdio%2Fnetbird%2Fpull%2F6856&signature=d129bab25a3781c3600be7a06ae8d7beac9b6dc9ecfee7ebfec805f7423f71e3"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with Codesmith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a> <sup>Need help on this PR? Tag <code>/codesmith</code> with what you need. Autofix is disabled.</sup> <!-- codesmith:autofix:disabled --> <!-- /codesmith:footer --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved handling when the background service is unavailable during connection attempts. * The Connect option remains available so users can receive clear error feedback instead of an unsuccessful connection attempt. * **New Features** * Added localized error messages explaining that the background service could not be reached and providing actionable guidance. * Added a dedicated connection error dialog for this condition. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:09:32 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#29964