Skip to content

SDK drift: TypeScript WS client connection handshake has no timeout, unlike Python's bounded per-attempt timeout #1497

Description

@realfishsam

Drift

Python's _connect_websocket() bounds each connection attempt to an explicit 10-second timeout (ws.connect(url, timeout=timeout) with timeout=10, from _ensure_connected), on top of its 3-attempt retry loop. TypeScript's connect() constructs the WebSocket and waits indefinitely on onopen/onerror with no timer at all — if the TCP handshake stalls (firewall silently drops packets, server hangs without ever emitting an error event), the returned promise from ensureConnected() never settles, and callers of subscribe()/subscribeBatch() hang forever (the waitForData timeout only starts after ensureConnected() resolves).

TypeScript SDK

sdks/typescript/pmxt/ws-client.ts:78-152connect() has no timeout on the underlying handshake; ws.onopen/ws.onerror are the only ways the promise settles.

Python SDK

sdks/python/pmxt/ws_client.py:26-45,122-140_connect_websocket(ws, url, timeout=timeout) with timeout=10 per attempt inside _ensure_connected's CONNECT_ATTEMPTS loop.

Expected

TypeScript should apply an explicit connect-level timeout (independent of the already-known missing-retry issue) so a stalled handshake fails fast instead of hanging indefinitely.

Impact

A stalled/unresponsive server or network path causes TypeScript callers to hang with no bound at all, whereas Python guarantees a bounded failure within ~10s per attempt.


Found by automated SDK cross-language drift audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions