[client] Update fyne and add exit menu retry#5187
Conversation
- Fix an extra arrow on macos by updating fyne/systray - Add retry to get exit node items to workaround async status
📝 WalkthroughWalkthroughThe changes introduce a trigger to update exit nodes when the systray tray opens, update the systray dependency to a newer version, and remove an empty line from a network utility file. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@client/ui/client_ui.go`:
- Line 921: Restore the original user-facing status text by changing the call to
s.mStatus.SetTitle("Connected2") back to s.mStatus.SetTitle("Connected"); this
corrects the accidental debug/typo in the status label without affecting the
macOS arrow or retry logic, so update the string in the s.mStatus.SetTitle
invocation accordingly.
🧹 Nitpick comments (1)
client/ui/network.go (1)
344-357: Consider extracting retry constants and adding debug logging.The retry mechanism addresses the asynchronous status retrieval issue as intended. A few suggestions to improve maintainability:
- Extract the magic numbers (3 attempts, 1 second delay) as named constants
- Add debug logging to indicate retry attempts for easier troubleshooting
♻️ Suggested improvements
+const ( + exitNodeRetryAttempts = 3 + exitNodeRetryInterval = 1 * time.Second +) + func (s *serviceClient) updateExitNodes() { conn, err := s.getSrvClient(defaultFailTimeout) if err != nil { log.Errorf("get client: %v", err) return } // todo: on a new GUI version, we should implementing a better way to get routes information since // the client might appear ready, it doesn't have the network map yet. var exitNodes []*proto.Network - for i := 0; i < 3; i++ { + for i := 0; i < exitNodeRetryAttempts; i++ { exitNodes, err = s.getExitNodes(conn) if err != nil { log.Errorf("get exit nodes: %v", err) return } if len(exitNodes) != 0 { break } - time.Sleep(1 * time.Second) + log.Debugf("exit nodes empty, retrying (%d/%d)", i+1, exitNodeRetryAttempts) + time.Sleep(exitNodeRetryInterval) }
|



Describe your changes
Fix an extra arrow on macos by updating fyne/systray
Add retry to get exit node items to workaround async status
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.