mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-16 21:59:56 +00:00
The Fyne UI used to write the active profile to both fronts on every switch (profile.go:264-273): the daemon SwitchProfile RPC for /var/lib/netbird/active_profile.json, then profileManager.SwitchProfile for the user-side ~/Library/Application Support/netbird/active_profile. The Wails ProfileSwitcher only kept the first. Without the user-side mirror, a UI tray switch updates the daemon's state but the CLI ProfileManager.GetActiveProfile() still returns the stale "default". The next "netbird up" then sends ProfileName="default" in the Login/Up request, and the daemon silently switches back to default, reverting whatever the user just picked in the tray. Mirror the daemon switch with profilemanager.NewProfileManager(). SwitchProfile after the daemon RPC succeeds. The daemon stays the authority — a user-side write failure is logged as a warning, not a hard error.