[PR #4160] [CLOSED] [client, relay] Add client part of the relay version changes #22633

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4160
Author: @pappz
Created: 7/16/2025
Status: Closed

Base: mainHead: feature/relay-feature-versioning


📝 Commits (7)

  • 0568622 Add client part of the relay version changes
  • 7be3892 Fix import
  • 0bad81b Revert function signature usage
  • 04619fe Revert error handling behaviour in test
  • fcb06d1 Revert error handling behaviour in test to support auto net.Conn creation
  • 929388c Fix sonar issue
  • 23cc698 Fix warn message

📊 Changes

9 files changed (+114 additions, -39 deletions)

View changed files

relay/client/addr.go (+0 -13)
📝 relay/client/client.go (+24 -6)
📝 relay/client/client_test.go (+4 -9)
📝 relay/client/conn.go (+2 -2)
📝 relay/client/manager_test.go (+4 -4)
📝 relay/client/peer_subscription.go (+19 -0)
relay/messages/addr.go (+56 -0)
📝 relay/messages/message.go (+4 -4)
📝 relay/messages/message_test.go (+1 -1)

📄 Description

Describe your changes

This PR implements client-side support for the updated relay protocol (version 2) by parsing relay addresses from the auth response payload, adding version-aware features, and making the peer subscription logic safe for nil subscriptions.

  • Bump protocol version and adjust UnmarshalAuthResponse to return raw payload bytes.
  • Introduce RelayAddr parsing with JSON and old-format fallback.
  • Integrate version check in client before enabling peer state subscription and add nil-safe guards.

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

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


🔄 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/4160 **Author:** [@pappz](https://github.com/pappz) **Created:** 7/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/relay-feature-versioning` --- ### 📝 Commits (7) - [`0568622`](https://github.com/netbirdio/netbird/commit/0568622d636b05143b0fffb6c04716c187aadff8) Add client part of the relay version changes - [`7be3892`](https://github.com/netbirdio/netbird/commit/7be389289c09243c519be5d1b3271beac3b72227) Fix import - [`0bad81b`](https://github.com/netbirdio/netbird/commit/0bad81b99e594ce7a3efd571543bf6b295d70068) Revert function signature usage - [`04619fe`](https://github.com/netbirdio/netbird/commit/04619fe54f54d4233166106be8e0bed591dc561f) Revert error handling behaviour in test - [`fcb06d1`](https://github.com/netbirdio/netbird/commit/fcb06d1a235fe54fb801a0be6f5b1b02ffca04d9) Revert error handling behaviour in test to support auto net.Conn creation - [`929388c`](https://github.com/netbirdio/netbird/commit/929388c5f4a448619f1939b17154f1b351cacd7e) Fix sonar issue - [`23cc698`](https://github.com/netbirdio/netbird/commit/23cc698c4d29b1a77c21792e93710f5dfeb86c4f) Fix warn message ### 📊 Changes **9 files changed** (+114 additions, -39 deletions) <details> <summary>View changed files</summary> ➖ `relay/client/addr.go` (+0 -13) 📝 `relay/client/client.go` (+24 -6) 📝 `relay/client/client_test.go` (+4 -9) 📝 `relay/client/conn.go` (+2 -2) 📝 `relay/client/manager_test.go` (+4 -4) 📝 `relay/client/peer_subscription.go` (+19 -0) ➕ `relay/messages/addr.go` (+56 -0) 📝 `relay/messages/message.go` (+4 -4) 📝 `relay/messages/message_test.go` (+1 -1) </details> ### 📄 Description ## Describe your changes This PR implements client-side support for the updated relay protocol (version 2) by parsing relay addresses from the auth response payload, adding version-aware features, and making the peer subscription logic safe for nil subscriptions. - Bump protocol version and adjust UnmarshalAuthResponse to return raw payload bytes. - Introduce RelayAddr parsing with JSON and old-format fallback. - Integrate version check in client before enabling peer state subscription and add nil-safe guards. ## 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) - [ ] Extended the README / documentation, if necessary > 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). --- <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 06:06:11 -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#22633