Skip to content

fix(client-runtime): T3 Connect setup timeouts say which side lost its network - #17630

Closed
josephv123 wants to merge 1 commit into
pingdotgg:mainfrom
josephv123:fix/relay-timeout-attribution
Closed

josephv123 wants to merge 1 commit into
pingdotgg:mainfrom
josephv123:fix/relay-timeout-attribution

Conversation

@josephv123

Copy link
Copy Markdown
Contributor

Problem

When a T3 Connect connection times out during setup, the client always says " did not respond during connection setup. Your DNS or firewall may be blocking T3 Connect." It says this even when the client itself lost internet. In #17629 the remote host was healthy, with its tunnel registered and no errors, and the client's Wi-Fi had dropped. The message pointed at the wrong machine. navigator.onLine stayed true, so the app never showed its offline state.

Change

  • ManagedRelayClient.checkReachable sends a GET to the relay's public /health endpoint with a 2.5 second timeout. Any HTTP response counts as reachable, because an unhealthy relay is still reachable. Only a transport failure or a timeout counts as unreachable.
  • ConnectionDriver.checkRelay exposes that check to the supervisor.
  • When a setup attempt on an environment with a T3 Connect route times out, the supervisor runs the check and picks the message:
    • Relay unreachable: "This device could not reach T3 Connect. Check your internet connection. Your DNS or firewall may be blocking T3 Connect. Try another network, such as a phone hotspot."
    • Relay reachable: " did not respond during connection setup. It may be asleep or offline, or its network may be blocking T3 Connect."
  • Environments without a T3 Connect route keep the old message, with no extra request.

The check runs only after a setup timeout, so a healthy connection makes no extra requests. All of this lives in client-runtime, so web, desktop, and mobile pick it up together.

Scope and approval

Fixes #17629. This is a small fix to a misleading error. It changes no connection or retry behavior, only which message a setup timeout shows.

Verification

  • vp test run on the touched suites (supervisor, managedRelay, registry, discovery, managedRelayState, authorization layer): 163 passed. New tests cover:
    • supervisor: a stalled relay setup this device can reach blames the environment, and one it cannot reach blames this device's network.
    • managedRelay: a 503 counts as reachable, while a failed fetch and a stalled request don't.
  • tsc --noEmit for packages/client-runtime, apps/web, and apps/mobile: clean.
  • vp lint and vp fmt --check on the changed files: clean.
  • Not checked in a real client. I didn't reproduce a live Wi-Fi drop against the production relay.

Made with Claude Opus 5.5 in Claude Code (T3 Code).

…s network

When a T3 Connect connection stalls during setup, check whether this device
can reach the relay. If it cannot, say so and point at this device's internet
connection instead of blaming the environment.

Fixes pingdotgg#17629
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 9, 2026
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f509e0c5-5e31-4535-9bd3-90b8306f94b5

📥 Commits

Reviewing files that changed from the base of the PR and between a0a0e94 and 5f23f76.


📒 Files selected for processing (9)
  • packages/client-runtime/src/authorization/layer.test.ts
  • packages/client-runtime/src/connection/driver.ts
  • packages/client-runtime/src/connection/registry.test.ts
  • packages/client-runtime/src/connection/supervisor.test.ts
  • packages/client-runtime/src/connection/supervisor.ts
  • packages/client-runtime/src/relay/discovery.test.ts
  • packages/client-runtime/src/relay/managedRelay.test.ts
  • packages/client-runtime/src/relay/managedRelay.ts
  • packages/client-runtime/src/relay/managedRelayState.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The managed relay client now reports relay reachability. The connection driver exposes this check, and the supervisor uses its result to choose setup-timeout details.

Changes

Relay Timeout Diagnostics

Layer / File(s) Summary
Managed relay reachability check
packages/client-runtime/src/relay/managedRelay.ts, packages/client-runtime/src/relay/managedRelay.test.ts, packages/client-runtime/src/relay/discovery.test.ts, packages/client-runtime/src/relay/managedRelayState.test.ts, packages/client-runtime/src/authorization/layer.test.ts
ManagedRelayClient checks the health endpoint with a 2,500 ms timeout. Any HTTP response counts as reachable; a timeout or failure returns false. Test clients implement the new check.
Expose relay reachability to the supervisor
packages/client-runtime/src/connection/driver.ts, packages/client-runtime/src/connection/registry.test.ts
The connection driver exposes checkRelay through ManagedRelayClient.checkReachable. The driver test mock implements the new operation.
Select setup timeout details
packages/client-runtime/src/connection/supervisor.ts, packages/client-runtime/src/connection/supervisor.test.ts
For relay setup timeouts, the supervisor checks reachability. An unreachable relay produces a device-network message with NETWORK_BLOCKING_HINT; a reachable relay produces an environment-related message.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant EnvironmentSupervisor
  participant ConnectionDriver
  participant ManagedRelayClient
  participant RelayHealthEndpoint
  EnvironmentSupervisor->>ConnectionDriver: checkRelay on relay setup timeout
  ConnectionDriver->>ManagedRelayClient: checkReachable
  ManagedRelayClient->>RelayHealthEndpoint: GET health endpoint
  RelayHealthEndpoint-->>ManagedRelayClient: HTTP response or request failure
  ManagedRelayClient-->>ConnectionDriver: reachable boolean
  ConnectionDriver-->>EnvironmentSupervisor: relay reachability
  EnvironmentSupervisor->>EnvironmentSupervisor: select timeout detail
Loading

Suggested reviewers: juliusmarminge


Merge Risk

Merge Risk: ⚪ Minimal · up to 5f23f

This changes only the text of setup-timeout messages when a T3 Connect relay is involved. Connection and retry behavior stay the same. Real-client behavior was not checked, but no merge-blocking risk is evident.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5f23f

The new check is bounded and selects diagnostic text rather than granting access or changing authentication. Existing connection cleanup remains in place. Risk is low, with uncertainty about platform-specific redirects and ambient credentials, and a short additional delay before timeout-state convergence.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated incremental exposure is a client-originated diagnostic request after a relay-capable setup timeout. Its result does not grant environment access, alter tenant selection, or create a connection lease.

Trust Boundaries and Controls

  • observed — The health check supplies no application authorization or DPoP headers; those headers are constructed separately for authenticated operations. The inspected fetch wiring does not explicitly constrain redirects or ambient credentials, leaving concrete platform behavior unresolved rather than establishing credential leakage.

Resilience and Maintainability Implications

  • observed — Failed route attempts close their scopes, successful establishment checks current intent before publishing session ownership, and runAttempt guarantees lease clearing. These existing controls remain around the new diagnostic wait; the inspected change does not bypass them.



Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title is concise, uses conventional commit format, and clearly describes the main change to T3 Connect setup-timeout messaging.
Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the behavior, links the fix to issue #17629, reports focused test results, and states …
Linked Issues check Passed Issue #17629 is directly linked and has coding requirements. The change adds ManagedRelayClient.checkReachable with a 2,500 ms health request. Any HTTP response returns reachable. Transport failures…
Out of Scope Changes check Passed The changes stay within issue #17629. Production changes implement relay reachability, driver wiring, and setup-timeout message selection. Test-harness updates and new tests support this behavior. The…


✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector
@macroscopeapp

macroscopeapp Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 5f23f76

Macroscope's review found this PR approvable — This is a small, well-tested client-runtime bug fix that improves timeout attribution without changing connection or retry behavior. The only added network activity is a bounded relay health check performed after a relay setup timeout.

You can add or adjust custom eligibility rules. Learn more.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Thanks for investigating the misleading T3 Connect timeout message. The new relay probe chooses which network the message points to, but the description explicitly says it was not checked in a real client and provides no before/after UI evidence. Our verification rule requires evidence matching the changed behavior; please reproduce a client network drop against a healthy host and show the resulting diagnostics before requesting reconsideration. Please keep the underlying diagnosis problem in an issue so it remains available for maintainer work.

@maria-rcks maria-rcks closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: T3 Connect setup timeout blames the remote environment when this device lost its network

3 participants