Skip to content

Send unicast to selected peer, have windows see multiple instances (and pass the new discovery tests)#19

Merged
ldemailly merged 15 commits intomainfrom
conn8
Oct 22, 2025
Merged

Send unicast to selected peer, have windows see multiple instances (and pass the new discovery tests)#19
ldemailly merged 15 commits intomainfrom
conn8

Conversation

@ldemailly
Copy link
Copy Markdown
Member

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 78.09524% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.59%. Comparing base (12564c1) to head (ab2c450).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tsnet/tsnet.go 82.00% 13 Missing and 5 partials ⚠️
main.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #19       +/-   ##
===========================================
+ Coverage   32.75%   54.59%   +21.83%     
===========================================
  Files           9        9               
  Lines         693      784       +91     
===========================================
+ Hits          227      428      +201     
+ Misses        458      314      -144     
- Partials        8       42       +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ldemailly ldemailly requested a review from Copilot October 22, 2025 04:45
Copy link
Copy Markdown

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 implements unicast messaging to enable direct peer-to-peer connections after multicast discovery. The changes introduce a connection management system where peers can initiate direct UDP connections to each other, supplementing the existing multicast discovery mechanism.

Key Changes:

  • Added unicast receiver alongside multicast for handling direct peer connections
  • Implemented connection request/response protocol with connection state tracking
  • Created comprehensive test suite for peer discovery and multi-peer scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tsnet/tsnet.go Core implementation of unicast messaging, connection management, and protocol message formats
tsnet/tsnet_test.go New test file with peer discovery and multi-peer connection tests
main.go Integration of ConnectToPeer functionality with user input
WARP.md Documentation update describing the new connection capabilities
Comments suppressed due to low confidence (1)

tsnet/tsnet.go:1

  • Variable shadowing: expected is declared twice in this test function (lines 185 and 209), which could lead to confusion. The second declaration should use a different name like expectedPeers.
// Package tsnet is the network library support for tsync (discovery/registration and communication).

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

@ldemailly ldemailly requested a review from Copilot October 22, 2025 05:08
@ldemailly ldemailly changed the title Send unicast to selected peer Send unicast to selected peer, have windows see multiple instances (and pass the new discovery tests) Oct 22, 2025
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.


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

@ldemailly ldemailly requested a review from Copilot October 22, 2025 05:11
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.


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

@ldemailly ldemailly requested a review from Copilot October 22, 2025 05:27
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.


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

Comment on lines +406 to +408
AcceptMessageFormat = "accept1 %q" // target_name
RejectMessageFormat = "reject1 %q %q" // target_name, reason
DataMessageFormat = "data1 %q %s" // target_name, signed_data
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

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

Several message formats (AcceptMessageFormat, RejectMessageFormat, DataMessageFormat) are defined but never used in the codebase. Consider removing unused constants or implementing the corresponding message handlers if they're planned for future use.

Suggested change
AcceptMessageFormat = "accept1 %q" // target_name
RejectMessageFormat = "reject1 %q %q" // target_name, reason
DataMessageFormat = "data1 %q %s" // target_name, signed_data

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

will add that later

@ldemailly ldemailly requested a review from Copilot October 22, 2025 05:37
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.


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

@ldemailly ldemailly requested a review from Copilot October 22, 2025 05:42
Copy link
Copy Markdown

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.


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

@ldemailly ldemailly merged commit 5b33b38 into main Oct 22, 2025
9 checks passed
@ldemailly ldemailly deleted the conn8 branch October 22, 2025 05:49
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.

2 participants