Skip to content

fix(desktop): recover remote workers on another gateway route - #1252

Merged
nixuuu merged 3 commits into
devfrom
fix/worker-stale-gateway-port
Nov 24, 2026
Merged

nixuuu merged 3 commits into
devfrom
fix/worker-stale-gateway-port

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Problem

A paired Remote Desktop can reach a gateway through an alternate route while its bundled worker keeps retrying an unavailable address from its existing enrollment.

Change

Keep the worker's saved route as its first choice. After a WorkerLink transport error or a timed-out Hello to Welcome handshake, consider the paired gateway's HTTPS routes only when its fingerprint matches the worker's own pin. Verify the TLS pin and authenticate the existing worker through ProbeNetworkRoute before moving WorkerLink and UpdateService. If a candidate passes the probe but fails to open WorkerLink, try the remaining candidates before retrying one that failed. Keep the selected alternate in memory so the worker profile, identity and journal remain intact.

Thanks @marcinniewinski for reporting and helping diagnose the issue.

Fixes: #68

Verification

  • Linux thread worker, revision 19b089f4a: 34 integration tests passed with temp-directory cleanup. Coverage includes healthy primary route, canceled WorkerLink streams on primary and alternate routes, handshake timeout, failover for WorkerLink and UpdateService, recovery after Desktop restart, rejection of a differently pinned endpoint, and existing enrollment and route migration paths.
  • Linux thread worker, revision 73cb2adc3: a separate runtime reproduction held TCP open without completing TLS on the saved route. The worker timed out, authenticated through the alternate and kept the original profile intact.
  • Desktop and worker typechecks and targeted lint, formatting and test-shard checks passed locally.
  • The two tests that failed in separate CI shards on the first revision passed when rerun with their suites on Linux at 73cb2adc3, 13 tests total. The GitHub-create failure also reproduced on clean dev and passed in CI on 19b089f4a.
  • Windows: the native CI workflow passed the strengthened reconnect regression on 19b089f4a with a real bundled worker process and TLS fixtures. The original Windows installation has only been checked for TCP reachability so far.

@nixuuu
nixuuu marked this pull request as ready for review November 24, 2026 20:55
@nixuuu
nixuuu merged commit 644e382 into dev Nov 24, 2026
23 checks passed
@nixuuu
nixuuu deleted the fix/worker-stale-gateway-port branch November 24, 2026 21:19
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