Skip to content

Keep ambiguous Tailscale hostname matches unlinked - #128

Merged
liamdevss merged 2 commits into
serveroshq:mainfrom
TrivCodez:fix/tailscale-unambiguous-hostname-linking
Nov 29, 2026
Merged

liamdevss merged 2 commits into
serveroshq:mainfrom
TrivCodez:fix/tailscale-unambiguous-hostname-linking

Conversation

@TrivCodez

Copy link
Copy Markdown
Contributor

Fixes #127

TailscaleDevices::link() previously checked whether each unlinked device matched exactly one remaining machine, but not whether multiple devices matched that same machine. When duplicate tailnet devices shared a hostname, whichever row was processed first could be linked arbitrarily.

This change counts eligible hostname candidates before linking any rows and only uses a hostname match when exactly one unlinked, non-external device matches that machine. Address and endpoint matches still take precedence. A feature test covers two devices sharing one machine hostname and expects both to remain unlinked.

Testing: Not run locally. This environment has no Git, PHP, or Composer installation, so the Tailscale feature test and project checks could not be run here. Please run CI and php artisan test --compact tests/Feature/Integrations/TailscaleTest.php before marking this ready.

AI disclosure: This change was prepared with AI assistance; the author should review the code and test before marking the PR ready.

@liamdevss
liamdevss marked this pull request as ready for review November 29, 2026 09:56
@liamdevss
liamdevss requested a review from a team as a code owner November 29, 2026 09:56

@liamdevss liamdevss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checked locally: the new test fails on main and passes with the fix. Thanks for this.

@liamdevss
liamdevss merged commit 947c267 into serveroshq:main Nov 29, 2026
8 checks passed
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.

Tailscale linking can choose an arbitrary device when hostnames collide

2 participants