[PR #6363] [client] Preserve user deselect-all across management route sync #29419

Open
opened 2026-08-05 08:08:02 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/6363

State: closed
Merged: Yes


A user-initiated "deselect all" was being cleared on every route sync, so deselected networks and exit nodes turned themselves back on whenever the client connected or restarted. The management auto-apply path called into the selector and reset the deselect-all flag, re-enabling routes the user had explicitly turned off.

  • Skip management auto-apply when the user has deselected all routes, so the persisted selection survives connects and restarts
  • Add an IsDeselectAll accessor on the route selector
  • Add tests covering management auto-apply, SkipAutoApply, user-selection override, and the deselect-all regression

Related to #2155

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)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

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)

This restores intended persistence behavior and adds no user-facing surface.

Summary by CodeRabbit

  • Bug Fixes

    • Route selection preferences are now preserved when management updates occur. Users who explicitly deselect all routes will no longer be overridden by automatic route management.
  • Tests

    • Added comprehensive test coverage for route selection behavior during management synchronization.
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/6363 **State:** closed **Merged:** Yes --- A user-initiated "deselect all" was being cleared on every route sync, so deselected networks and exit nodes turned themselves back on whenever the client connected or restarted. The management auto-apply path called into the selector and reset the deselect-all flag, re-enabling routes the user had explicitly turned off. - Skip management auto-apply when the user has deselected all routes, so the persisted selection survives connects and restarts - Add an `IsDeselectAll` accessor on the route selector - Add tests covering management auto-apply, SkipAutoApply, user-selection override, and the deselect-all regression ## Issue ticket number and link Related to #2155 ## Stack <!-- branch-stack --> ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) - [ ] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#discuss-changes-with-the-netbird-team-first). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) This restores intended persistence behavior and adds no user-facing surface. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Route selection preferences are now preserved when management updates occur. Users who explicitly deselect all routes will no longer be overridden by automatic route management. * **Tests** * Added comprehensive test coverage for route selection behavior during management synchronization. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 08:08:02 -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#29419