[PR #796] [MERGED] Update calculate server state #13009

Closed
opened 2026-08-05 02:07:14 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/796
Author: @mlsmaycon
Created: 4/7/2023
Status: Merged
Merged: 4/10/2023
Merged by: @mlsmaycon

Base: mainHead: calculate-disconnecting-state


📝 Commits (7)

  • d0cb6bf Calculate disconnecting state
  • d48b7d5 update current state
  • 31b2453 refactor state calculation
  • c55d0de no need for stopped state
  • 50370a9 keep on disconnecting
  • f7d23d5 avoid status update if context is canceled
  • 8ca5140 properly exit backoff when context is canceld

📊 Changes

5 files changed (+46 additions, -44 deletions)

View changed files

📝 client/internal/connect.go (+2 -3)
📝 client/internal/peer/notifier.go (+14 -21)
📝 client/internal/peer/notifier_test.go (+7 -8)
📝 management/client/grpc.go (+12 -7)
📝 signal/client/grpc.go (+11 -5)

📄 Description

Describe your changes

Refactored updateServerStates and calculateState

added some checks to ensure we are not sending connecting on context canceled

removed some state updates from the RunClient function

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)
  • Extended the README / documentation, if necessary

🔄 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/796 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 4/7/2023 **Status:** ✅ Merged **Merged:** 4/10/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `calculate-disconnecting-state` --- ### 📝 Commits (7) - [`d0cb6bf`](https://github.com/netbirdio/netbird/commit/d0cb6bf71163cf3a5ff355e670bd54d19ecb67b2) Calculate disconnecting state - [`d48b7d5`](https://github.com/netbirdio/netbird/commit/d48b7d5b30d615d67d628ff764f6728bd81f29c0) update current state - [`31b2453`](https://github.com/netbirdio/netbird/commit/31b24532000fc00d1f04298f4dbfa42aad045ec5) refactor state calculation - [`c55d0de`](https://github.com/netbirdio/netbird/commit/c55d0de013252623559dcfbe820405e2a151923e) no need for stopped state - [`50370a9`](https://github.com/netbirdio/netbird/commit/50370a9b6c018deac6c5c563b2318d1bade8c807) keep on disconnecting - [`f7d23d5`](https://github.com/netbirdio/netbird/commit/f7d23d5946b6169e8f02e804e98de419051c1826) avoid status update if context is canceled - [`8ca5140`](https://github.com/netbirdio/netbird/commit/8ca51403bee13f3a09aa208693ddd84bb437caaf) properly exit backoff when context is canceld ### 📊 Changes **5 files changed** (+46 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/connect.go` (+2 -3) 📝 `client/internal/peer/notifier.go` (+14 -21) 📝 `client/internal/peer/notifier_test.go` (+7 -8) 📝 `management/client/grpc.go` (+12 -7) 📝 `signal/client/grpc.go` (+11 -5) </details> ### 📄 Description ## Describe your changes Refactored updateServerStates and calculateState added some checks to ensure we are not sending connecting on context canceled removed some state updates from the RunClient function ## Issue ticket number and link ### 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) - [ ] Extended the README / documentation, if necessary --- <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 02:07:14 -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#13009