Skip to content

Pair devices by QR code and keep finding the Mac after address changes - #29

Merged
varyform merged 1 commit into
varyform:mainfrom
saphid:fix/qr-pairing-reachability-20261114
Nov 14, 2026
Merged

varyform merged 1 commit into
varyform:mainfrom
saphid:fix/qr-pairing-reachability-20261114

Conversation

@saphid

@saphid saphid commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

NX Play can find a Mac through Bonjour on the same Wi-Fi, but discovery can disappear after an app update or address change. This adds QR pairing and lets the device reconnect through the addresses the user accepted.

This is the focused pairing/reachability successor invited in #11. Sources, Linux and the control API/CLI/MCP are outside this contribution. MacLink remote builds are unchanged.

  • Mac Settings → Devices adds Show QR Code, a configurable port, and local/Tailscale addresses. Bonjour registration retries until macOS confirms it. Tailscale status is read without changing its settings.
  • QR pairing checks /v1/hello against the Mac ID in the link before sending the pairing code, then saves the user-confirmed address list. A newly discovered address needs confirmation. Manual entry retains compatibility with older NX Play versions without /v1/hello.
  • The scanner hands off after dismissal and ignores stale callbacks. Library controller commands are ignored while pairing sheets are open or dismissing. Shared link parsing and the Mac-runnable iOS logic tests use symlinks.

Mac Settings → Devices, before/after still-state comparison. These are actual Debug app captures using the built-in screenshot mode with synthetic data; listening/install status is sample data. Each still lasts three seconds. The QR sheet opens/dismisses through accessibility, but its capture protection excludes its pixels, so the QR layout and scanning are not visually verified.

Before main and after candidate: Mac Devices settings with sample data

Candidate address list, sample data

Candidate local and Tailscale addresses in Mac Devices settings

Validation:

  • Mac Release build passes, with no warning/error diagnostics (Xcode 26.6). Unsigned generic-iOS Release build passes with Xcode 27.2 / Swift 6.4.2. xcresult records zero errors/warnings; the raw iOS log has the App Intents metadata-extraction warning for an app without AppIntents.framework. XcodeGen was 2.45.4 versus the 2.46.0 pin.
  • Focused pairing/server/network/install-copy checks: 33 pass. Mac-runnable iOS logic tests: 24 pass. shellcheck nxplay bin/* passes.
  • Package suites remain red: candidate 270 tests/2 issues, main 241 tests/4 issues. All four historical assertions reproduce on unchanged main: ambient-profile GameSettings, intermittent MacLink TLS, and two FolderWatch observations. A separate candidate repeat also failed the ignored-order-file watcher assertion; that exact failure has not reproduced on main and remains unexplained. Fresh source review found no changed execution path that establishes a regression. No claim of a passing package suite.

Draft pending live verification. No iPhone/iPad/controller, camera-permission flow, pairing over GameSheet, cross-host Bonjour/Tailscale, or real port/pairing persistence run. The Mac UI pass used sample data. The owner offered iPhone/iPad pairing checks before merging; CI ran and failed in the MacLink TLS pairing test: aCodeForgivesMisreadingsAndPairsOnce returned .unreachable (270 tests, one issue). The unsigned build step was skipped after that failure. This matches the inherited MacLink failure seen in local main controls; its cause is being investigated.

Created with Anthropic Claude Opus 5.5 in Claude Code; review repairs by OpenAI GPT-6.1 Sol in Codex, through T3 Code. Fresh full-patch independent review: GPT-6.1 Sol, high reasoning, Codex; no actionable executable-source findings. Source approval is separate from runtime and merge readiness.

@varyform
varyform marked this pull request as ready for review November 14, 2026 06:20
@varyform
varyform merged commit 2d498b9 into varyform:main Nov 14, 2026
2 of 3 checks passed
varyform added a commit that referenced this pull request Nov 14, 2026
…s unreleased

A Mac with VPNs, bridges and IPv6 lists ten addresses, which pushed the rest
of Devices off screen though the QR code carries them anyway; the whole row
opens them, as Advanced settings does in a game's settings.

PR #29 was branched before 2.0.1, so its changelog entries landed under that
released heading: they move to Unreleased, with thanks to its author.
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