[PR #6992] [MERGED] [client] Android - Drop the initial GetNetworkMap fetch on Android startup #29389

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6992
Author: @pappz
Created: 7/30/2026
Status: Merged
Merged: 8/3/2026
Merged by: @pappz

Base: fix/android-pull-tun-settings-on-rebuildHead: refactor/android-drop-inital-netmap


📝 Commits (1)

  • 23d4587 [client] Drop the initial GetNetworkMap fetch on Android startup

📊 Changes

9 files changed (+5 additions, -199 deletions)

View changed files

📝 client/internal/engine.go (+4 -47)
📝 client/internal/routemanager/manager.go (+1 -59)
📝 client/internal/routemanager/mock.go (+0 -5)
📝 client/internal/routemanager/notifier/notifier_android.go (+0 -27)
📝 client/internal/routemanager/notifier/notifier_ios.go (+0 -4)
📝 client/internal/routemanager/notifier/notifier_other.go (+0 -8)
📝 shared/management/client/client.go (+0 -1)
📝 shared/management/client/grpc.go (+0 -43)
📝 shared/management/client/mock.go (+0 -5)

📄 Description

Describe your changes

Android startup opened a throwaway Sync stream to management before creating the TUN device, only to learn the initial routes, DNS config and the DNS feature flag. Server side this computed a full network map and broadcast a false connect/disconnect pair to every peer in the account on every Android start; client side it put a blocking network round trip on the critical startup path and failed the whole engine start when management was unreachable.

None of its outputs are needed upfront anymore: the TUN is created empty and the first sync triggers a rebuild that pulls the fresh route and search domain state, the permanent DNS server starts with an empty config that the first sync populates, and the fake IP manager is created lazily when the DNS feature flag turns on.

Remove readInitialSettings and its plumbing: the InitialRoutes and DNSFeatureFlag manager config fields, the android construction-time route setup, the initial-route bookkeeping in the notifiers and the now-unused GetNetworkMap client method.

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)

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


🔄 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/6992 **Author:** [@pappz](https://github.com/pappz) **Created:** 7/30/2026 **Status:** ✅ Merged **Merged:** 8/3/2026 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `fix/android-pull-tun-settings-on-rebuild` ← **Head:** `refactor/android-drop-inital-netmap` --- ### 📝 Commits (1) - [`23d4587`](https://github.com/netbirdio/netbird/commit/23d4587ef5c61b9ad9bb79fc883e836fc7e94d80) [client] Drop the initial GetNetworkMap fetch on Android startup ### 📊 Changes **9 files changed** (+5 additions, -199 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+4 -47) 📝 `client/internal/routemanager/manager.go` (+1 -59) 📝 `client/internal/routemanager/mock.go` (+0 -5) 📝 `client/internal/routemanager/notifier/notifier_android.go` (+0 -27) 📝 `client/internal/routemanager/notifier/notifier_ios.go` (+0 -4) 📝 `client/internal/routemanager/notifier/notifier_other.go` (+0 -8) 📝 `shared/management/client/client.go` (+0 -1) 📝 `shared/management/client/grpc.go` (+0 -43) 📝 `shared/management/client/mock.go` (+0 -5) </details> ### 📄 Description ## Describe your changes Android startup opened a throwaway Sync stream to management before creating the TUN device, only to learn the initial routes, DNS config and the DNS feature flag. Server side this computed a full network map and broadcast a false connect/disconnect pair to every peer in the account on every Android start; client side it put a blocking network round trip on the critical startup path and failed the whole engine start when management was unreachable. None of its outputs are needed upfront anymore: the TUN is created empty and the first sync triggers a rebuild that pulls the fresh route and search domain state, the permanent DNS server starts with an empty config that the first sync populates, and the fake IP manager is created lazily when the DNS feature flag turns on. Remove readInitialSettings and its plumbing: the InitialRoutes and DNSFeatureFlag manager config fields, the android construction-time route setup, the initial-route bookkeeping in the notifiers and the now-unused GetNetworkMap client method. ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] 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](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) ### 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/__ --- <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 08:07:59 -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#29389