Skip to content

refactor(trackerless-network): unify naming and refactor selectParallelTargets #3156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juslesan
Copy link
Contributor

@juslesan juslesan commented Jun 16, 2025

Summary

No longer nodes that are attempted as neighbors neighbors. Added getExcludedIds helper function to remove duplicate code. Added clearer comments to explain the control flow. Fixed a bug where nodes were pushed to excludedIds too soon.

@juslesan juslesan requested a review from Copilot June 16, 2025 11:52
@github-actions github-actions bot added the network Related to Network Package label Jun 16, 2025
Copy link
Contributor

@Copilot 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 refactors the handshake target selection logic in the neighbor discovery module by unifying naming and reducing code duplication.

  • Renamed local variables from "neighbors" to "targets" for clarity.
  • Introduced the getExcludedIds helper function to consolidate exclusion logic.
  • Updated handshake functions to use consistent naming.
Comments suppressed due to low confidence (1)

packages/trackerless-network/src/content-delivery-layer/neighbor-discovery/Handshaker.ts:79

  • [nitpick] Consider renaming the helper function 'getExcludedIds' to a more descriptive name (e.g., 'aggregateExcludedIds') to clarify that it combines the initial exclusions with the keys from 'targets'.
const getExcludedIds = () => [...excludedIds, ...Array.from(targets.keys())]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network Related to Network Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant