[PR #2993] [MERGED] [client] Fix race condition with systray ready #15956

Closed
opened 2026-08-05 03:08:43 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2993
Author: @mohamed-essam
Created: 12/5/2024
Status: Merged
Merged: 12/14/2024
Merged by: @braginini

Base: mainHead: netbird-ui-startup-race


📝 Commits (1)

  • b2e2ea3 Fix race condition with systray ready

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 client/ui/client_ui.go (+1 -0)

📄 Description

Describe your changes

fyne.io/systray package calls onTrayReady before fully initializing, causing some calls (e.g SetIcon) to fail silently because props global variable inside systray package is not yet set, while the MenuItems can be updated normally without failure.

This causes netbird-ui icon to stay stuck on Disconnected if netbird service was running and connected before netbird-ui starts up.

This is mainly a workaround since the issue in systray is not responsive.

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)
  • Extended the README / documentation, if necessary

🔄 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/2993 **Author:** [@mohamed-essam](https://github.com/mohamed-essam) **Created:** 12/5/2024 **Status:** ✅ Merged **Merged:** 12/14/2024 **Merged by:** [@braginini](https://github.com/braginini) **Base:** `main` ← **Head:** `netbird-ui-startup-race` --- ### 📝 Commits (1) - [`b2e2ea3`](https://github.com/netbirdio/netbird/commit/b2e2ea3226dabf86ce62fad0ebab0c3cfac1cda6) Fix race condition with systray ready ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/ui/client_ui.go` (+1 -0) </details> ### 📄 Description ## Describe your changes fyne.io/systray package [calls onTrayReady before fully initializing](https://github.com/fyne-io/systray/blob/v1.11.0/systray_unix.go#L161), causing some calls (e.g SetIcon) to [fail silently](https://github.com/fyne-io/systray/blob/v1.11.0/systray_unix.go#L58-L60) because `props` global variable inside systray package is not yet set, while the [MenuItems can be updated normally without failure](https://github.com/fyne-io/systray/blob/v1.11.0/systray.go#L213-L223). This causes netbird-ui icon to stay stuck on Disconnected if netbird service was running and connected before netbird-ui starts up. This is mainly a workaround since the [issue in systray is not responsive](https://github.com/fyne-io/systray/issues/35). ## Issue ticket number and link ### Checklist - [X] 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) - [ ] Extended the README / documentation, if necessary --- <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 03:08:43 -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#15956