Skip to content

TursoDriverConfig.timeout has no seam on the WebSocket transport (wss:// / ws://) in @libsql/client 0.17.4 — documented as unbounded, not delivered #16378

Description

@claude

Surfaced while implementing #16024 (PR #16376), which gave TursoDriverConfig.timeout real behaviour. Filed bare for triage as an observation: after that PR the key is honest about this gap, but the gap is still there.

What was measured

@libsql/client@0.17.4 (@libsql/core@0.17.4, @libsql/hrana-client@0.10.0), read in the worktree at f377394ae:

  • Config.fetch is consulted only by the HTTP client (lib-esm/http.js hands it to hrana.openHttp(url, authToken, customFetch, …), whose HttpClient routes every request through it). lib-esm/ws.js never reads fetch, and @libsql/hrana-client's WebSocket client exposes no timeout option (grep for timeout over lib-esm/ws/*.js and lib-esm/index.js: 0 hits; the same grep over lib-esm/http/ finds the fetch call sites, so the zero is not a grep that does not work).
  • Config.timeout is the busy timeout for local file: databases — its own docblock says "remote clients ignore it".

So after #16376 the driver bounds remote operations over HTTP (libsql://, https://, http:// — the client resolves libsql:// to HTTPS) and bounds sync() on the replica arm, but a remote URL spelled wss:// / ws:// — which TursoDriver.detectMode accepts as remote — has no seam through which timeout can reach the WebSocket transport. The key's docblock and README now say so explicitly instead of promising it.

Why a card

A wss:// deployment that sets timeout reads an honest docblock, but the setting is still a declared no-op on that one transport — the ADR-0049 shape, narrowed to one URL scheme. Options for whoever picks it up, none recommended here:

  • (a) route wss:// / ws:// remote URLs through the HTTP transport when timeout is set — changes the wire protocol behind the author's back, needs a ruling;
  • (b) bound each RemoteTransport client call with a driver-side race, as the replica arm's sync() does — fails the caller within the window without cancelling the in-flight WebSocket request;
  • (c) refuse timeout together with a WebSocket URL at construction, so the no-op is loud;
  • (d) leave it documented, as it is now.

Related: #16024 · #16376 · ADR-0049


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions