Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/internals/09_connection-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ consume the runtime. Keeping retry and session ownership here prevents competing
failures use jittered, capped exponential backoff that resets only after a connection stays up;
offline and auth failures wait for an explicit wakeup.
- Foregrounding, network changes, explicit retries, and offline reports probe the established
session rather than blindly reconnecting (OS offline reports are often wrong, especially for
loopback). Only a failed probe replaces the socket.
session rather than tearing it down (OS offline reports are often wrong, especially for
loopback). When the host answers a fresh request while the socket stays silent, on non-loopback
network changes, or when a better route appears, a replacement connects beside the live session
and takes over in place without showing a reconnect; a non-upgrade replacement closes if the live
socket proves alive, and a worse-route replacement waits as fallback.
- The [registry](../../packages/client-runtime/src/connection/registry.ts) scopes connections by
environment. An involuntary disconnect keeps the registration and cached projections; explicit
removal closes the scope and clears credentials, caches, and drafts. Cloud-account changes apply
Expand Down
2 changes: 1 addition & 1 deletion packages/client-runtime/src/connection/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export type RoutePreflight = "ready" | "refused" | "unprepared" | "silent" | "un
const ROUTE_CHECK_TIMEOUT_MS = 2_500;
// Preferred direct routes share one head start, so a relay connection does not
// wait the full probe timeout for a LAN the device has already left. A route
// that misses it connects over relay, then upgrades with a second reconnect.
// that misses it connects over relay, then upgrades over a second connection.
const ROUTE_CHECK_HEAD_START_MS = 500;

export class ConnectionDriver extends Context.Service<
Expand Down
Loading
Loading