Skip to content

Conversation

@hakansa
Copy link
Contributor

@hakansa hakansa commented Oct 9, 2025

Describe your changes

[managament] sync all other peers on peer add/remove

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

Copilot AI review requested due to automatic review settings October 9, 2025 15:38
Copy link
Contributor

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

This PR removes conditional logic for peer synchronization and makes all peers sync on peer add/remove operations regardless of group membership status. The change simplifies the code by removing the isPeerInActiveGroup check and always triggering peer updates.

  • Removes conditional logic that checked if a peer was in an active group before triggering synchronization
  • Ensures all other peers are notified when any peer is added or removed from the account
  • Simplifies the codebase by removing the updateAccountPeers variable and related logic

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

if updateAccountPeers {
am.BufferUpdateAccountPeers(ctx, accountID)
}
am.BufferUpdateAccountPeers(ctx, accountID)
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The removal of the conditional check causes this line to be unconditionally executed, but it's missing proper indentation. The line should be properly aligned with the surrounding code block.

Copilot uses AI. Check for mistakes.
pascal-fischer
pascal-fischer previously approved these changes Oct 9, 2025
pascal-fischer
pascal-fischer previously approved these changes Oct 9, 2025
case <-done:
case <-time.After(time.Second):
t.Error("timeout waiting for peerShouldNotReceiveUpdate")
t.Error("timeout waiting for peerShouldReceiveUpdate")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did the log change?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 9, 2025

@pascal-fischer pascal-fischer merged commit d35a845 into main Oct 9, 2025
55 of 56 checks passed
@pascal-fischer pascal-fischer deleted the fix/sync-add-rmv-peer branch October 9, 2025 19:18
hurricanehrndz added a commit to hurricanehrndz/netbird that referenced this pull request Oct 24, 2025
* upstream/main: (135 commits)
  [signal] Fix HTTP/WebSocket proxy not using custom certificates (netbirdio#4644)
  [client] Fix active profile name in debug bundle (netbirdio#4689)
  [management] Add peer disapproval reason (netbirdio#4468)
  [misc] Update tag name extraction in install.sh (netbirdio#4677)
  [client] Clean up match domain reg entries between config changes (netbirdio#4676)
  [client] Delete TURNConfig section from script (netbirdio#4639)
  [client] Security upgrade alpine from 3.22.0 to 3.22.2 netbirdio#4618
  [client] Fix status showing P2P without connection (netbirdio#4661)
  [client] Support BROWSER env for login (netbirdio#4654)
  [client] Remove rule squashing (netbirdio#4653)
  Handle the case when the service has already been down and the status recorder is not available (netbirdio#4652)
  [client] Set default wg port for new profiles (netbirdio#4651)
  [client] Add bind activity listener to bypass udp sockets (netbirdio#4646)
  [client] Fix missing flag values in profiles (netbirdio#4650)
  [management] feat: Basic PocketID IDP integration (netbirdio#4529)
  [client] Force TLS1.2 for RDP with Win11/Server2025 for CredSSP compatibility (netbirdio#4617)
  [misc] Add service definition for netbird-signal (netbirdio#4620)
  [management] pass temporary flag to validator (netbirdio#4599)
  [client] Explicitly disable DNSOverTLS for systemd-resolved (netbirdio#4579)
  [management] sync all other peers on peer add/remove (netbirdio#4614)
  ...
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.

3 participants