Skip to content

Conversation

pappz
Copy link
Contributor

@pappz pappz commented Sep 17, 2025

Describe your changes

This PR improves the NetBird client's status checking mechanism by implementing earlier detection of client state changes and better handling of connection lifecycle management. The key improvements focus on:

• Enhanced status detection - Added waitForReady option to StatusRequest for improved client status handling
• Better connection management - Improved context handling for signal and management gRPC connections• Reduced connection timeouts - Increased gRPC dial timeout from 3 to 10 seconds for better reliability
• Cleaner error handling - Enhanced error propagation and context cancellation in retry loops

Key Changes

Core Status Improvements:

  • Added waitForReady optional field to StatusRequest proto (daemon.proto:190)
  • Enhanced status checking logic to detect client state changes earlier in the connection process
  • Improved handling of client permanent exit scenarios from retry loops

Connection & Context Management:

  • Fixed context cancellation in management and signal client retry mechanisms
  • Added proper context propagation for Login operations
  • Enhanced gRPC connection handling with better timeout management

Error Handling & Cleanup:

  • Moved feedback channels to upper layers for better separation of concerns
  • Improved error handling patterns throughout the client server implementation
  • Fixed synchronization issues and removed debug logging

Issue ticket number and link

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)

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

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

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/__

@pappz pappz marked this pull request as ready for review September 17, 2025 18:39
@Copilot Copilot AI review requested due to automatic review settings September 17, 2025 18:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link

@mlsmaycon mlsmaycon requested a review from Copilot September 20, 2025 20:09
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mlsmaycon mlsmaycon merged commit 998fb30 into main Sep 20, 2025
35 checks passed
@mlsmaycon mlsmaycon deleted the fix/status-check branch September 20, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants