Skip to content
Merged
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
4 changes: 2 additions & 2 deletions packages/client-runtime/src/state/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function initialConfigOption<E>(
);
}

// Bounded like the snapshot fetches: a wedged environment must not pin the
// permissions check (and with it the settings UI) in a loading state for long.
// Bounded so a wedged environment cannot pin the permissions check (and with it
// the settings UI) in a loading state for long.
const DEFAULT_SESSION_STATE_TIMEOUT_MS = 6_000;

/**
Expand Down
10 changes: 7 additions & 3 deletions packages/client-runtime/src/state/shellSnapshotHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ import { environmentEndpointUrl } from "../environment/endpoint.ts";
import { ManagedRelayDpopSigner } from "../relay/managedRelay.ts";
import { executeAuthenticatedEnvironmentHttpRequest } from "./environmentHttpAuth.ts";

// Bounded so a pathologically slow endpoint cannot block the (cheaper) socket
// fallback for long. The cached shell renders while this runs.
const DEFAULT_SHELL_SNAPSHOT_TIMEOUT_MS = 6_000;
// Long enough for a slow but alive server to finish. On timeout the socket asks
// the same server for the same full snapshot, so a short deadline only throws
// the first build away. The socket fallback is for setups where /api fails but
// /ws works, such as a proxy that blocks /api. A dead server is caught by the
// socket ping, which drops the session and interrupts this load. The cached
// shell renders while this runs.
const DEFAULT_SHELL_SNAPSHOT_TIMEOUT_MS = 20_000;

/**
* Load the environment shell snapshot (projects + thread shells) over HTTP
Expand Down
11 changes: 7 additions & 4 deletions packages/client-runtime/src/state/threadSnapshotHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ import { ManagedRelayDpopSigner } from "../relay/managedRelay.ts";
import type { RemoteEnvironmentRequestError } from "../rpc/http.ts";
import { executeAuthenticatedEnvironmentHttpRequest } from "./environmentHttpAuth.ts";

// Bounded so a pathologically slow endpoint cannot block the (cheaper) socket
// fallback for long. The cached thread renders while this runs, so the wait only
// delays the transition to live data on the first open, not the initial paint.
const DEFAULT_THREAD_SNAPSHOT_TIMEOUT_MS = 6_000;
// Long enough for a slow but alive server to finish. On a cold open a timeout
// makes the socket ask the same server for the same snapshot again, and older
// turn pages have no fallback, so a short deadline only drops work. The socket
// fallback is for setups where /api fails but /ws works, such as a proxy that
// blocks /api. A dead server drops the socket session, which interrupts a
// cold-open load. Older turn pages wait for this deadline.
const DEFAULT_THREAD_SNAPSHOT_TIMEOUT_MS = 20_000;

/**
* Load a thread's detail snapshot over HTTP instead of embedding it in the
Expand Down
Loading