Skip to content

Wake reconnect when the Mac becomes available - #15

Draft
Netscale1 wants to merge 11 commits into
mainfrom
codex/event-driven-reconnect
Draft

Netscale1 wants to merge 11 commits into
mainfrom
codex/event-driven-reconnect

Conversation

@Netscale1

@Netscale1 Netscale1 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

What changed

  • wake the Windows reconnect loop when the Mac advertises the existing _ech0._tcp DNS-SD service
  • keep the existing 1/2/4/8 second TCP backoff as the fallback when DNS-SD is unavailable or filtered
  • run one native browse for at most 30 seconds per disconnected episode
  • cancel discovery immediately after authentication and remove completed discovery tasks from subsequent retries
  • wait for the documented final cancellation callback before releasing native browse state
  • add deterministic tests for discovery wake, fallback, no-service, cancellation, and native browse cancellation

Why

The first connection could wait for the next backoff slot even after the Mac receiver became available. DNS-SD was already implemented for manual discovery but was not connected to the automatic reconnect loop.

Impact and safety

Reconnect can start as soon as the Mac appears on the local network. The authenticated handshake remains authoritative; discovery is only a wake signal and never replaces the configured endpoint.

The discovery cost is bounded to the first 30 seconds of a disconnected episode. While connected there is no browser. After discovery completes or times out, retries return to the same delay-only path as the baseline.

Validation

  • final commit: 02359eaa787b221aa979f17b79eb6969269978b2
  • Windows isolated gate: 44/44 tests; warning-as-error 44/44; self-contained publish and manifest verified
  • native cancellation test: 36 ms, no hang
  • native .NET 10 LAN probe: _ech0._tcp found in 16 ms, exit 0
  • GitHub macOS and Windows CI passed on the final commit; CodeQL is required before readiness
  • installed Ech0, settings, Parsec processes, and audio routing were not changed

Remaining gate

Keep this PR draft until the final CodeQL jobs finish and the candidate is exercised once through the real app startup/reconnect flow.

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.

1 participant